07 2018 档案
59.加载Viewcontroller的几种方法(添加导航,解决xib里面空间不显示问题)
摘要:- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { UIStoryboard *storyboard = [UIStoryboar 阅读全文
posted @ 2018-07-31 14:40 强者VS弱者 阅读(284) 评论(0) 推荐(0) 编辑
58.UIScrollView XIB拖拽约束
摘要:第一步: 拖拽UIScrollView 到控制器上 ,给scrollView 添加约束 ,这时是正常的 第二步:scrollview上添加UIview ,(注意:这个 ScrollView就是根据这个UIview 来确定ContentSize的大小的).这时,会报红色警告,不用管,也不要处理(下面这 阅读全文
posted @ 2018-07-27 16:19 强者VS弱者 阅读(298) 评论(0) 推荐(0) 编辑
57.移除指定视图
摘要://依次遍历self.view中的所有子视图 // for(id tmpView in [view subviews]) // { // //找到要删除的子视图的对象 // if([tmpView isKindOfClass:[UIView class]]) // { // UIView *line 阅读全文
posted @ 2018-07-27 13:54 强者VS弱者 阅读(170) 评论(0) 推荐(0) 编辑
56.九宫格布局
摘要:- (void)viewDidLoad { [super viewDidLoad]; //每个Item宽高 CGFloat W = 80; CGFloat H = 100; //每行列数 NSInteger rank = 3; //每列间距 CGFloat rankMargin = (self.vi 阅读全文
posted @ 2018-07-25 16:29 强者VS弱者 阅读(173) 评论(0) 推荐(0) 编辑
55.UIbutton点击切换颜色
摘要:#import "ViewController.h" #define width_w [UIScreen mainScreen].bounds.size.width #define height_h [UIScreen mainScreen].bounds.size.height #define P 阅读全文
posted @ 2018-07-25 14:17 强者VS弱者 阅读(269) 评论(0) 推荐(0) 编辑
54.NSJSONSerialization类进行json解析(字符串“UTF-8解码”)
摘要:NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingAllowFragments error:nil] ; 方法:解析并转码 - (NSString*)data 阅读全文
posted @ 2018-07-25 10:23 强者VS弱者 阅读(360) 评论(0) 推荐(0) 编辑
53.设置内容的行间距
摘要://设置介绍内容行间距 -(void)LineSpacing:(UILabel*)lab{ NSMutableAttributedString * attributedString1 = [[NSMutableAttributedString alloc] initWithString:lab.te 阅读全文
posted @ 2018-07-17 15:19 强者VS弱者 阅读(99) 评论(0) 推荐(0) 编辑
52.tableViewCell重用机制避免重复显示问题
摘要:表刷新超出页面显示的内容会重复出现 -(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ //定义唯一标识 static NSString *cell 阅读全文
posted @ 2018-07-06 17:20 强者VS弱者 阅读(180) 评论(0) 推荐(0) 编辑


点击右上角即可分享
微信分享提示