趣好玩开发日志 02-day
控制台可能输出以下警告信息
CUICatalog: Invalid asset name supplied: (null)
- 警告原因:
[UIImage imageNamed:nil];
CUICatalog: Invalid asset name supplied:
- 警告原因:
[UIImage imageNamed:@""]
准确判断字符串是否有内容
if(string.length){
}
/***错误写法
if(string){
}因为有可能出现 @"" 这种情况
**/
布局子控件
- -(void)layoutSubviews : 布局子控件方法
自定义tabBar
- 如果想替换TabBarController的tabBar,需要使用KVC模式
[self setValue:[[MYTabBar alloc]init]forKey:@"tabBar"];
因为UITabBarController中UITabBar的属性为readonly
打印当前函数名称
NSLog(@"%s",__func__)
巧用内边距
- 在处理一些控件的位置的时候,可以巧用内边距
- imageEdgeInsets 图片内边距
- titleEdgeInsets 文字内边距
- contentEdgeInsets 所有内容内边距