随笔分类 -  iOS

摘要:[btn setImage:imgNor forState:UIControlStateNormal]; [btn setImage:imgSel forState:UIControlStateSelected]; [btn setTitle:[arrLa... 阅读全文
posted @ 2015-09-09 18:40 爱生活爱代码 阅读(1117) 评论(0) 推荐(0)
摘要:有一个项目 需要用到友盟分享,点击分享内容,需要跳转到指定的url,不带参数的url非常好跳,也没什么问题,但是 带了参数之后:比如http://121.43.121.8:8080/tj/photo/findPhotoInfo?&param={"photoId":"15080604463114388... 阅读全文
posted @ 2015-08-31 22:52 爱生活爱代码 阅读(2445) 评论(0) 推荐(0)
摘要:写的较好的博客:http://blog.csdn.net/xyz_lmn/article/details/9312837 http://www.cnblogs.com/wuhenke/archive/2012/02/07/2341656.htmlFMDB github:https://github.... 阅读全文
posted @ 2015-08-31 16:03 爱生活爱代码 阅读(171) 评论(0) 推荐(0)
摘要:1.使用系统自带的,并且可以在小红点上显示数字。 [itemOne setBadgeValue:@""]; //显示不带数字的小红点 [itemOne setBadgeValue:@"1"];//显示小红点 并且带数字以上的缺点:小红点太大了,伤不起啊!2.使用图片,创建图片的时候,设置图片的渲染。... 阅读全文
posted @ 2015-08-31 10:52 爱生活爱代码 阅读(5325) 评论(0) 推荐(0)
摘要:首先看一张比较简单明了的 iPhone 6 与 iPhone 6 Plus 对比图,来自 PaintCode 的《The Ultimate Guide To iPhone Resolutions》:iPhone 6 Plus 要比 iPhone 6 的屏幕宽 39 Point,分辨率更是高出不少,因... 阅读全文
posted @ 2015-08-24 22:24 爱生活爱代码 阅读(1217) 评论(0) 推荐(0)
摘要:原文地址:http://blog.csdn.net/idoshi201109/article/details/46007125OS调用系统通讯录获取姓名电话号码(iOS 8.0 Xcode6.3可以使用)1、导入头文件。#import#import2、添加协议@interfaceNewAddress... 阅读全文
posted @ 2015-08-16 15:00 爱生活爱代码 阅读(508) 评论(0) 推荐(0)
摘要:在NavigationController中,调用pushViewController可以将界面推到指定的界面,调用popToViewController可以返回上层界面,可是它的实现原理是什么?好吧,说到原理,就要看源码,可是源码被封装了,看不到,那就不谈原理,那就谈谈 它为什么知道你pop的是上... 阅读全文
posted @ 2015-08-12 14:53 爱生活爱代码 阅读(427) 评论(0) 推荐(0)
摘要:1.要求:服务器给一张图片模板,要在模版上镂空,然后添加一些别的图片,然后组合成一张图,这个模版的像素 不是固定的,有可能比 当前手机屏幕大。所以,在组合截图的时候,有一定的要求。贴代码: 1 /** 2 * 组合图片 imgVC_bg :模版image存放的uiimageview ,... 阅读全文
posted @ 2015-08-07 16:22 爱生活爱代码 阅读(1705) 评论(0) 推荐(0)
摘要://创建UITextField对象UITextField* tf=[[UITextFieldalloc]init];//设置Placeholder颜色[text setAttributedPlaceholder:[[NSAttributedString alloc]initWithString:Cu... 阅读全文
posted @ 2015-07-27 14:43 爱生活爱代码 阅读(4710) 评论(3) 推荐(0)
摘要:UIPickerView*pickerView = [[UIPickerViewalloc]initWithFrame:CGRectZero];pickerView.autoresizingMask=UIViewAutoresizingFlexibleHeight|UIViewAutoresizin... 阅读全文
posted @ 2015-07-08 11:42 爱生活爱代码 阅读(1598) 评论(0) 推荐(0)
摘要:最近在ios8.0使用CLLocationManager定位服务,发现老不能定位,查看设置菜单中的项也是处于未知状态.想起之前都有一个弹出框提示用户是否允许定位,这次一直没有出现了.原来ios8.0下的定位服务需要申请授权了.具体代码如下:if ([CLLocationManager locatio... 阅读全文
posted @ 2015-07-07 15:53 爱生活爱代码 阅读(522) 评论(0) 推荐(0)
摘要:[UIApplication sharedApplication].idleTimerDisabled=YES;// 不自动锁屏 [UIApplication sharedApplication].idleTimerDisabled=NO;// 自动锁屏 阅读全文
posted @ 2015-07-06 14:30 爱生活爱代码 阅读(507) 评论(0) 推荐(0)
摘要:转载自:http://www.cnblogs.com/wayne23/p/4013522.html初始化部分:UICollectionViewFlowLayout *flowLayout= [[UICollectionViewFlowLayout alloc]init];self.myCollect... 阅读全文
posted @ 2015-07-05 14:35 爱生活爱代码 阅读(355) 评论(0) 推荐(0)
摘要://初始化当前视图 _currentImageView = [[UIImageView alloc] init]; [_currentImageView setImageWithURL:[NSURL URLWithString:[array_pic objectAtI... 阅读全文
posted @ 2015-07-03 11:16 爱生活爱代码 阅读(264) 评论(0) 推荐(0)
摘要:我编码如下,但我发现 webViewDidFinishLoad() 会发生若干次。如何知道 webViewDidFinishLoad() 最后发生吗?iNavigate = 0;- (void)webViewDidFinishLoad:(UIWebView *)webView { iN... 阅读全文
posted @ 2015-06-30 14:02 爱生活爱代码 阅读(5469) 评论(0) 推荐(0)
摘要:rangeOfString是在containsString没出来之前 用于查找字符串中是否包含某字符,iOS <8.0NSString *str1 = @"can you \n speak English"; NSString *str = @"\n"; //在str1这个字符串... 阅读全文
posted @ 2015-06-30 11:06 爱生活爱代码 阅读(1340) 评论(0) 推荐(0)
摘要:UITbarController之前有在这篇文章讲解:http://www.cnblogs.com/niit-soft-518/p/4447940.html如果自定义了UITabBarItem的图片,用上述文章创建的时候,发现选中的图的边框颜色默认是蓝色的,解决这个问题就需要设置 UIImage的渲... 阅读全文
posted @ 2015-06-28 14:38 爱生活爱代码 阅读(1010) 评论(0) 推荐(0)
摘要:在 iOS 8上,状态栏变成透明的了,这点很好,这时候如果设计背景色为纯黑色的 图片浏览,感觉很棒(应为背景色纯黑色,状态栏也变成了纯黑色,所以导致 状态栏 隐藏的假象).但是,有个奇葩的客户,充电的时候去浏览,呵呵,电池绿色的图标就显示出来了,你妈的,还和我说:“绿色的图片大小会随着电池电量的大小... 阅读全文
posted @ 2015-06-25 11:00 爱生活爱代码 阅读(979) 评论(0) 推荐(1)
摘要://当应用程序将要进入非活动状态执行,在此期间,应用程序不接受消息或事件,比如来电 - (void)applicationWillResignActive:(UIApplication *)application { NSLog(@"应用程序将要进入非活动状态,即将进入后台"); }... 阅读全文
posted @ 2015-06-24 14:01 爱生活爱代码 阅读(542) 评论(0) 推荐(0)
摘要:步骤1:info.plist文件中添加:Required background modes字段,里面的item 值选择:App plays audio or streams audio/video using AirPlay步骤二:在Appdelegate.m中:- (BOOL)applicatio... 阅读全文
posted @ 2015-06-22 12:55 爱生活爱代码 阅读(549) 评论(0) 推荐(0)