iphone
qq562475163
这个作者很懒,什么都没留下…
展开
-
UITabBarController TabBarItem 点击事件
要判断UITabBarController的哪个TabBarItem被点击了或者点击之后要做相应的处理,可以在定义 UITabBarController的文件:XXXXXXTabBarController.m 中重写 -(void) tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item //当点击相应得UITabBar原创 2012-04-24 17:48:24 · 7629 阅读 · 2 评论 -
使用autolayout设置UITableView的tableHeaderView
网上资料比较少,都没有代码,答案在折腾很久后解决了,也有段时间没有写文章了。 使用Masonry开源框架来写,下面直接贴代码给正在遭受折磨的人 UIView *headView = [[UIView alloc] init]; self.tableView.tableHeaderView = headView; [headView mas_makeConstra原创 2015-09-14 14:24:25 · 5227 阅读 · 1 评论 -
uitableview 奇怪现象原因之一
1.uitableview出现滑动的时候cell 一闪一闪 2.uitableview出现莫名颜色空白区域 原因:返回高度的数据源方法 返回类型错误CGFloat---》float原创 2014-06-16 16:23:54 · 994 阅读 · 2 评论 -
UIWebview 打开html文件一直不显示问题
html保存时会提示“网页 html”和“网页 全部”,当选择前者时用系统控件UIWebview不能打开,只有选择后者才能打开原创 2014-03-03 14:19:52 · 1108 阅读 · 0 评论 -
iphone相对精准nstimer实现
由于项目需要实现10s之内每0.1s就要执行定时函数,误差不超过10毫秒级别,自己谷歌和观看了苹果的文档之后,发现苹果不建议使用高精度的定时器,说线程执行和切换这些都需要耗费时间。目前能谷歌到nstimer的资料就是可以精确到 50-100 毫秒,中间耗时或阻塞错过下一个点,这样会导致误差增大 能找到和想到的一些解决办法: 1.利用uiview的动画有时间控制来实现,时间间隔不能控原创 2013-11-12 17:45:37 · 2068 阅读 · 0 评论 -
dyld: Symbol not found: ___CFObjCIsCollectable 问题的解决
dyld: Symbol not found: ___CFObjCIsCollectable Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security Expected in: /Applications/Xcode 2.app/Contents/Developer/Platfo原创 2013-11-23 17:02:21 · 1709 阅读 · 0 评论 -
UIAlertView message 居左对齐 显示ios7以后不能用的启发
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:self.version message:versionConnet delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"更新", nil]; UILabel *label = [alert.subviews原创 2013-11-05 11:46:27 · 4192 阅读 · 0 评论 -
ios7加载uitableview界面突然内存猛增到1G多
NSMutableArray *coutryArray; - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return coutryArray; } 以上错误代码导致在ios7系统上加载次界面内存猛增到1G多,加载很卡。原创 2013-11-06 09:23:17 · 1258 阅读 · 0 评论 -
修改UISearchBar放大镜图片(_searchBar._searchField.leftView)
在-(void)viewDidLoad{}方法中添加如下代码: for(id cc in [_searchBar subviews]) { if([cc isKindOfClass:[UITextField class]]) { UITextField *textField = (UITextFie原创 2012-05-07 17:22:16 · 3118 阅读 · 0 评论 -
ios uiwebview 富文本图片自适应
- (void)webViewDidFinishLoad:(UIWebView *)webView { NSString *js=@"var script = document.createElement('script');" "script.type = 'text/javascript';" "script.text = \"function ResizeIma...原创 2019-01-27 21:43:58 · 384 阅读 · 0 评论