摘要: 属性: //设置每一行cell的高度 self.tableView.rowHeight //设置每一组头部的高度 self.tableView.sectionHeaderHeight //设置每一组尾部的高度 self.tableView.sectionFooterHeight //设置分割线颜色 阅读全文
posted @ 2020-04-07 00:57 千面客 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 属性: //设置右边的指示样式cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;//设置右边的指示控件 cell.accessoryView = [[UISwitch alloc] init];//设置cell的选中样式 阅读全文
posted @ 2020-04-07 00:48 千面客 阅读(277) 评论(0) 推荐(0) 编辑
摘要: dataSource: //遵守协议 @interface ViewController () <UITableViewDataSource> @end //设置数据源 self.tableView.dataSource = self; //实现数据源方法 // 多少组数据 - (NSInteger 阅读全文
posted @ 2020-04-07 00:36 千面客 阅读(62) 评论(0) 推荐(0) 编辑
摘要: 多次传入新图片,出现叠加效果 解决: 让self.scrollView.subViews数组中的所有控件都执行removeFromSuperView方法[self.scrollView.subViews makeObjectsPerformSelector:@selector(removeFromS 阅读全文
posted @ 2020-04-07 00:26 千面客 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 注意事项:NSTimer是一次性的,要么持续工作,一旦停止工作就无法再次使用 // 返回一个自动开启任务的定时器 self.timer = [NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(nextP 阅读全文
posted @ 2020-04-07 00:23 千面客 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 监听控件的行为: - 通过addTarget: 只有继承来自UICotrol的对象,才有这个功能 例如button - 通过delegate: 只有拥有delegate属性的控件,才有这个功能 例如UIScrollView,UITableView - 通过添加手势 一般给控价userinterfac 阅读全文
posted @ 2020-04-07 00:13 千面客 阅读(237) 评论(0) 推荐(0) 编辑
摘要: 使用场景:当内容数据一多,在可视的View中就展示不完,这时候就需要用到UIScrollView控件 contentSize设置内容尺寸:UIScrollView会隐藏超出内容的部分,相当于scrollView默认设置了clipToBounds为YES UIScrollView无法滚动的原因: 没有 阅读全文
posted @ 2020-04-07 00:10 千面客 阅读(338) 评论(0) 推荐(0) 编辑