敲代码时经常遇到的小细节

1.经常打注释


2.导航条背景颜色的设置

BINMeViewController *meVC = [[BINMeViewControlleralloc]init];

UINavigationController *meNav = [[UINavigationControlleralloc]initWithRootViewController:meVC];

meNav.navigationBar.barTintColor = [UIColorgreenColor];//这里是barTinColor不是backGroundColor


3.pch文件的生成和配置

当你处在工程中cmd+N弹出新窗口

选择PCH---->next选中target选项---->在PCH中添加你想公用的头文件---->选择PCH路径

1.选择项目中的buildSetting---->搜索prefix header---->选择LLVM7.0那个双击----->把pch文件拖进去


4.取消cell的选中状态

cell.selectionStyle = UITableViewCellSelectionStyleNone;


5.取消导航栏的自动扩展

self.navigationController.automaticallyAdjustsScrollViewInsets = NO;

self.navigationController.navigationBar.translucent = NO;

self.edgesForExtendedLayout = UIRectEdgeNone;



6.取消textField第一响应者

[self.viewendEditing:YES];

[textField resignFirstResponder];


7.cell右侧小箭头显示

cell.accessoryType = UITableviewCellAccessoryDisclosureIndicator;


8.当textfield设为不可编辑时,默认边框消失

_textfield.layer.borderWidth = 2.0;


9.想修改tableview的HeaderView时

1.重写titleForHeaderInSection

2.重写viewForHeaderInSection

如果不重写1,2重写无效


10.导航控制器push到新页面,要让后面的控制器不显示tabbar

[a push b];     b.hidesBottomBarWhenPushed = YES;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值