摘要: // GCD倒计时 (void)startCoundown { __block int timeout = showtime + 1; //倒计时时间 + 1 dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIO 阅读全文
posted @ 2016-08-29 14:55 GJR 阅读(1126) 评论(0) 推荐(0) 编辑
摘要: 需求 很多app(如淘宝、美团等)在启动图加载完毕后,还会显示几秒的广告,一般都有个跳过按钮可以跳过这个广告,有的app在点击广告页之后还会进入一个广告页面,点击返回进入首页。今天我们就来开发一个广告页面,效果如下。 思路 1.广告页加载思路。广告页的内容要实时显示,在无网络状态或者网速缓慢的情况下 阅读全文
posted @ 2016-08-29 11:25 GJR 阅读(451) 评论(0) 推荐(0) 编辑
摘要: (int)convertToInt:(NSString )strtemp { int strlength = 0; char p = (char )[strtemp cStringUsingEncoding:NSUnicodeStringEncoding]; for (int i=0 ; i 阅读全文
posted @ 2016-08-29 11:06 GJR 阅读(203) 评论(0) 推荐(0) 编辑
摘要: (void)setLabelSpace:(UILabel )label withValue:(NSString )str withFont:(UIFont )font { NSMutableParagraphStyle paraStyle = [[NSMutableParagraphStyle al 阅读全文
posted @ 2016-08-29 11:04 GJR 阅读(1308) 评论(0) 推荐(0) 编辑
摘要: NSDictionary attributes = @{NSFontAttributeName:[UIFont systemFontOfSize:14],NSForegroundColorAttributeName:[UIColor whiteColor]}; CGSize captionSize 阅读全文
posted @ 2016-08-02 15:08 GJR 阅读(301) 评论(0) 推荐(0) 编辑
摘要: 首先在iOS7.0修改UIActionSheet title的字体是很简单的,设置代理,在willPresentActionSheet方法中修改。代码如下: (void)willPresentActionSheet:(UIActionSheet )actionSheet { for (UIView 阅读全文
posted @ 2016-07-29 10:38 GJR 阅读(1842) 评论(0) 推荐(0) 编辑
摘要: //初始化textfield并设置位置及大小 UITextField text = [[UITextField alloc]initWithFrame:CGRectMake(20, 20, 130, 30)]; //设置边框样式,只有设置了才会显示边框样式 text.borderStyle = UI 阅读全文
posted @ 2016-07-19 17:24 GJR 阅读(138) 评论(0) 推荐(0) 编辑
摘要: import "ViewController.h" define MAXVALUE 10 define MINVALUE 5 @interface ViewController () @property (nonatomic, strong) UITextView textView; @proper 阅读全文
posted @ 2016-07-18 09:45 GJR 阅读(312) 评论(0) 推荐(0) 编辑
摘要: 想了下就决定用ScrolleView, ContentSize可以设置为560. 这样在其他屏幕上没有太多的影响,在3.5的屏幕下也可以滑动了。但是在StoryBord拖过ScrollView,添加约束的时候发现他并不会按照你猜想的去执行。经过查阅资料,大致知道了原因。这是由于scrollview本 阅读全文
posted @ 2016-07-12 11:45 GJR 阅读(206) 评论(0) 推荐(0) 编辑
摘要: //隐藏空的cell (UIView )tableView:(UITableView )tableView viewForFooterInSection:(NSInteger)section { if ([self numberOfSectionsInTableView:tableView]==(s 阅读全文
posted @ 2016-07-11 10:24 GJR 阅读(145) 评论(0) 推荐(0) 编辑