上一页 1 ··· 3 4 5 6 7 8 9 下一页
摘要: 可以使用UIScrollView、UIPageControl、NSTimer来创建,scrollview是图片的展示区域,UIPageControl是一行小圆点,用来表示当前展示的是多页面中的第几页,NSTimer用来循环执行某事件。这里边比较重要的方法是scrollViewDidScroll,就是... 阅读全文
posted @ 2015-09-01 15:40 lixin327 阅读(353) 评论(0) 推荐(0) 编辑
摘要: __weak typeof(self) weakSelf = self的应用 typeof(xxx)是用来确定括号中内容的类型,如 int a = 10; 可以这样写 typeof(100) a = 10; 这两种写法是等价的。那么回到上边,__weak typeof(self) weakSelf 阅读全文
posted @ 2015-09-01 15:29 lixin327 阅读(436) 评论(0) 推荐(0) 编辑
摘要: 1.关于textField在做一些操作,比如登录时账号或密码为空的处理时,有两种方案。①登录按钮可以点击,但会用alertView提示“账号或密码为空”的消息。②此时登录按钮不可点击,只有账号和密码都有值时,才可以点击。两种方法推荐第二种,体验较好。此时需要实现UITextFieldDelegate... 阅读全文
posted @ 2015-09-01 15:24 lixin327 阅读(197) 评论(0) 推荐(0) 编辑
摘要: 单例的写法,需要用到GCD。如下:在.h中@interface JFSingleton : NSObject@property(nonatomic,copy) NSString *tempStr;///类方法+(JFSingleton *) sharedInstance;@end在.m中,有两种写法... 阅读全文
posted @ 2015-08-12 17:52 lixin327 阅读(217) 评论(0) 推荐(0) 编辑
摘要: 本地推送将会在状态栏里、锁屏界面等出现通知。现在以在状态栏里的通知为例。 1 -(void)alertLoaclNotification{ 2 //初始化一个 UILocalNotification 3 UILocalNotification * notification = [[U... 阅读全文
posted @ 2015-08-12 17:47 lixin327 阅读(229) 评论(0) 推荐(0) 编辑
摘要: 1.通知NSNotification的使用NSNotification的名称在整个项目中必须是唯一的补充一个小知识,为了确保通知名称的唯一性,定义NSNotification的name时需要做些改变前边定义时如下#define AnyNotificationName @"notiName"最好写... 阅读全文
posted @ 2015-08-12 17:42 lixin327 阅读(282) 评论(0) 推荐(0) 编辑
摘要: 自定义cell,有下面几种方法方法一:在controller的.m中 1 @interface ViewController () 2 3 @property(nonatomic,strong) UITableView *tableView; 4 5 @end 6 7 @implementat... 阅读全文
posted @ 2015-07-28 17:30 lixin327 阅读(823) 评论(0) 推荐(0) 编辑
摘要: 之前虽然用过loadView和viewDidLoad这两个方法,但没有仔细研究过,现在反过头来看下。这些方法的执行顺序位loadView——>viewDidLoad——>viewWillAppear——>viewDidAppear①loadView是在每次访问uiviewController的vie... 阅读全文
posted @ 2015-07-27 16:43 lixin327 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 场景是这样的,点击按钮,开辟新线程,弹出alertView。然后调用dismissWithClickedButtonIndex让其消失。 1 /** 定义按钮 */ 2 -(void)setupAllBtns{ 3 UIButton *btn2 = [UIButton buttonWit... 阅读全文
posted @ 2015-07-27 16:38 lixin327 阅读(584) 评论(0) 推荐(0) 编辑
摘要: view的bounds默认的都为(0,0,self.frame.size.width,self.frame.size.height)view的位置是由view.frame决定的,而view.bounds决定的是其内子视图的原点。写个例子就明白了 1 - (void)viewDidLoad { 2 ... 阅读全文
posted @ 2015-07-27 16:30 lixin327 阅读(295) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 下一页