iOS开发常用技巧-常见问题篇
来源:互联网 发布:php连接数据库语句 编辑:程序博客网 时间:2024/06/05 11:57
1.需要在某些情况下在外部设置自定义cell中imageView的image时,如果直接设置imageView.image的话,可能会出现UI布局走样。这时可以在cell的头文件里声明一个UIImage,在UIImage的set方法中设置imageView的image,外部访问公开的UIImage来达到设置cell中imageView的image的目的。
2.比较两个UIImage的图片是否相同,可以先把图片转换成NSData,然后比较。
NSData *headerImageData = UIImagePNGRepresentation(weakSelf.headerImage); NSData *defaultImageData = UIImagePNGRepresentation(DefaultHeaderImage); if ([headerImageData isEqualToData:defaultImageData]) { NSLog(@"Same"); return; }
3.修改TableView侧边搜索栏背景及字体颜色
//点击后背景颜色table.sectionIndexTrackingBackgroundColor = [UIColor clearColor];//背景颜色table.sectionIndexBackgroundColor = [UIColor clearColor];//文字颜色table.sectionIndexColor = [UIColor colorWithHexString:@"#656565"];
4.修改状态栏颜色
参考文章
首先在info.plist里加入UIViewControllerBasedStatusBarAppearance,并设置为NO,然后添加代码
- (void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;}
5.修改AFN的超时时间
[manager.requestSerializer willChangeValueForKey:@"timeoutInterval"];manager.requestSerializer.timeoutInterval = 3.f;[manager.requestSerializer didChangeValueForKey:@"timeoutInterval"];
6.弹出键盘遮挡TextField的解决办法
7.iOS App图标和启动页图片大小
8.同一个view下多个collectionView不要共用一个UICollectionViewFlowLayout,否则会出现indexpath取值错误
9.如果用registerClass注册collectionView的cell,那么cell应该重写initWithFrame函数。如果用registerClass注册tableView的cell,那么cell应该重写initWithStyle:withReuseableCellIdentifier函数。
10.网络状态判断
11.iOS10相关问题
12iOS URL转码
13.时间戳与NSDate互转
14.Pop动画简介
15.iOS 动画简介
16.WKWebView简介
17.39个SwiftUI开源库
18.iOS键盘处理 使用说明
19.获取当前APP版本号
20.获取当前APP在AppStore中的版本号
21.iOS App跳转到AppStore和跳转到AppStore评价页面
22.iOSUIWebView清除缓存
23.iOSWKWebView清除缓存
24.macos 10.12 装cocoapods
- iOS开发常用技巧-常见问题篇
- iOS开发常用技巧
- IOS开发的一些技巧和常见问题
- IOS开发的一些技巧和常见问题
- ios开发常用技巧汇总
- ios开发常用的技巧
- iOS 常用开发及技巧
- ios开发常用技巧汇总
- iOS开发常用的技巧
- IOS开发的一些技巧和常见问题 转
- IOS开发中 常用调试技巧
- iOS开发的22个常用技巧
- iOS 开发中常用知识点和技巧
- ios开发中常用小技巧
- iOS 开发中一些不常用技巧
- iOS开发--常用技巧 (MJRefresh详解)
- iOS 一些常用的开发技巧
- iOS开发--常用技巧 (MJRefresh详解)
- 解决sublime在编译出错或警告时额外显示系统path的问题
- DFT,FFT和卷积(笔记)
- lucene入门及安装配置
- 心路杂谈
- Android不同分辨率图片实际显示大小的计算
- iOS开发常用技巧-常见问题篇
- 【Java】Object类的方法
- nameidata路径查找辅助结构
- java的菜单控件使用
- laravel 5.2 学习笔记
- BSOJ 4852:比赛 暴力优化
- codz.me's blog
- 【hihocoder】#1094 : Lost in the City
- Photoshop cs7发布,设计师将哭晕在厕所