iOS 遇到的小知识点总结
来源:互联网 发布:linux 改机器名 编辑:程序博客网 时间:2024/06/04 18:40
在开发过程中总是遇到一些小的知识点,太散不容易记住,每次还需要各种找,今天想把遇到的知识点总结起来,以备日后查看
1. 对NavigationController 中的navigationBar 进行隐藏以及显示会影响到其他的页面,因为 NavigationController 是全局共用一个的,所以我们在当前页面需要隐藏或者显示的时候不要忘了要在离开该页面时候恢复NavigationController 的状态
-(void)viewWillAppear:(BOOL)animated{ self.navigationController.navigationBar.hidden = YES;}-(void)viewWillDisappear:(BOOL)animated{ self.navigationController.navigationBar.hidden = NO;}
2.我们在进行页面跳转之后还想回到原来的页面不要使用跳转到该页面时候使用的 Push 或者 Present 方法,要使用下面的“返回”方法
[[self navigationController] popViewControllerAnimated:YES];
3.设置按钮的边框以及圆角
[doneBtn.layer setMasksToBounds:YES];// [doneBtn.layer setCornerRadius:8.0]; //设置矩圆角半径 [doneBtn.layer setBorderWidth:1.0]; //边框宽度 CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); CGColorRef colorref = CGColorCreate(colorSpace,(CGFloat[]){ 1, 0, 0, 1 }); [doneBtn.layer setBorderColor:colorref];//边框颜色
4.UITableViewCell 选中不变色
cell.selectionStyle = UITableViewCellSelectionStyleNone;
5.UITableViewStyleplain 类型无线
myTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
6.在本页面控制下一个页面的back状态以及事件
self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:self action:@selector(click_backBarButtonItem:)];- (void)click_backBarButtonItem:(UIBarButtonItem *)sender { [self.navigationController popViewControllerAnimated:YES];}
7.在使用UITableView 的HeaderView 或者FooterVIew 的时候必须设定 View 的高度
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { return 44.f;}- (UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{ SearchTableView *headerView = [[SearchTableView alloc]init]; return headerView;}
8.清除Xcode 的缓存文件
前往->文件夹->~/Library/Developer/Xcode/DerivedData 回车 删除即可
9.iOS语言是不支持多继承的,切记切记
未完待续。。。}
0 0
- iOS 遇到的小知识点总结
- iOS小知识点总结
- IOS小知识点总结
- 近期遇到小知识点总结
- iOS几个小知识点的总结
- ios一些开发中遇到的小知识点
- 项目过程中遇到的问题及小知识点总结
- 遇到的小知识点(不断更新)
- iOS遇到问题小总结
- iOS开发之最近的小知识点总结一
- 总结一下使用Swift遇到的几个小问题和几个小知识点
- IOS的小知识点补充
- iOS小知识点总结(一)
- iOS小知识点总结(二)
- Python学习中遇到的小知识点
- 做毕设遇到的几个小知识点
- 自己总结的小知识点
- 日常总结的小知识点
- [Android] 各种资料整合
- 快速掌握grep命令及正则表达式
- IOS Quartz 各种绘制图形用法---实现画图片、写文字、画线、椭圆、矩形、棱形等
- mysql查询今天、昨天、上周
- 修改devXpress ribbonForm左上角的DX图标
- iOS 遇到的小知识点总结
- Ext.grid.ColumnModel renderer 参数介绍
- 关于lua中显示绝对时间和相对时间
- linux 下C调用Python 模块
- spring框架学习(三)junit单元测试
- Junit简单使用(一 )
- 将10.2.0.5升级到11.2.0.4
- 关于cell中分割线的顶格显示的问题(两种解决办法)
- spring框架学习(二)依赖注入