摘要: storyboard文件的认识 用来描述软件界面 默认情况下,程序一启动就会加载Main.storyboard 加载storyboard时,会首先创建和显示箭头所指的控制器界面 IBAction和IBOutlet IBAction: 本质就是void 能让方法具备连线的功能 IBOutlet 能让属 阅读全文
posted @ 2016-02-29 10:47 zhangjing022 阅读(291) 评论(0) 推荐(0) 编辑
摘要: 自定义控件 选用xib用自定义view代码与xib相关联 示例代码 + (instancetype)shopView { return [self shopViewWithShop:nil]; } + (instancetype)shopViewWithShop:(XMGShop *)shop { 阅读全文
posted @ 2016-02-29 10:35 zhangjing022 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 如何选择UIButton、UILable、UIImageView 在不添加手势的前提下,只要不涉及到点击和多状态表现就尽量不要选择UIButton 阅读全文
posted @ 2016-02-29 10:34 zhangjing022 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 懒加载 在get中加载,且只加载一次 - (NSArray *)shops { if (_shops == nil) { NSString *file = [[NSBundle mainBundle] pathForResource:@"shops" ofType:@"plist"]; self.s 阅读全文
posted @ 2016-02-29 10:33 zhangjing022 阅读(160) 评论(0) 推荐(0) 编辑
摘要: plist是一种iOS本地化轻量级存储方式 创建plist 选择New File-> Resource->plist 加载plist //获得Plist文件的全路径 NSBundle *bundle = [NSBundle mainBundle]; NSString *path = [bundle 阅读全文
posted @ 2016-02-29 10:32 zhangjing022 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 提示框的背景透明此时要设置background的Alpha值 定时任务 方法1:performSelector // 1.5s后自动调用self的hideHUD方法 [self performSelector:@selector(hideHUD) withObject:nil afterDelay: 阅读全文
posted @ 2016-02-29 10:31 zhangjing022 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 代码创建UILabel UILabel *label = [[UILabel alloc] init]; label.text = @"单肩包"; label.frame = CGRectMake(0, 50, 50, 20); label.font = [UIFont systemFontOfSi 阅读全文
posted @ 2016-02-29 10:30 zhangjing022 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 按钮的功能比较多,既能显示文字,又能显示图片,还能随时调整内部图片和文字的位置 按钮也是一种容器,在这一点上跟UIView类似 按钮的三种状态 normal(普通状态) 默认情况(Default) 对应的枚举常量:UIControlStateNormal highlighted(高亮状态) 按钮被按 阅读全文
posted @ 2016-02-29 10:28 zhangjing022 阅读(129) 评论(0) 推荐(0) 编辑
摘要: UIView是Cocoa大多控件的父类,本身不带事件。 UIView的常见用法 @property(nonatomic,readonly) UIView *superview; 获得自己的父控件对象 @property(nonatomic,readonly,copy) NSArray *subvie 阅读全文
posted @ 2016-02-29 10:27 zhangjing022 阅读(150) 评论(0) 推荐(0) 编辑