2018年5月18日
1.tableView,考试页面展开和收起后,会发现有cell挡住重叠现象。
原因:子视图frame越界导致
解决:将父视图的如下属性打开即可
_titleView.clipsToBounds = YES;
2.tableViewCell 上的按钮 有时候可以点击,有时候不可以点击。
排查结果是把
cell.userInteractionEnabled = NO;关闭了导致
修改: 直接注释如上代码(默认cell.userInteractionEnabled = YES;)
3.管理界面 分割线往下拉的时候,有可能分割线丢失

image.png
原因:如下两个接口计算控件height的高度不一致(一个用了viewHeight[控件里面的属性],一个用NSString自适应函数)
- (void)config:(HuManageCourseListModel *)model
+ (CGFloat)cellHeightWithModel:(HuManageCourseListModel *)model
解决:全部改成用NSString自适应函数计算高度即可。
2018年4月17日
一.分页table,添加底部无数据说明
1.系统自带的无更多数据说明
//init分页设置
tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
_pageNum = firstPageNum;
[self onPullRefresh];
}];
tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
_pageNum++;
[self onPullRefresh];
}];
//回包处
[weakSelf.tableView.mj_footer endRefreshing];
[weakSelf.tableView.mj_header endRefreshing];
if (count < onePageSize) {
[tableView.mj_footer endRefreshingWithNoMoreData];
}
2.自定义我是有底线的

image.png
2017年7月4日
一.tableview删除行动作实现
1.效果:

image.png
2.实现
- (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
id obj = [self.recentSessions objectAtIndex:indexPath.row];
newMessTableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
NSString *flag = cell.sysType;
UITableViewRowAction *layTopRowAction1 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"删除" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
[MessageCenterHttps deleteAllMessage:@{@"systemMsgFlag" : flag, @"accountId" : [kUserDefaults objectForKey:@"loginId"]} view:self.view success:^(BOOL success) {
if (success) {
}
}];
[self.recentSessions removeObjectAtIndex:indexPath.row];
[self.tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
[tableView setEditing:NO animated:YES];
}];
layTopRowAction1.backgroundColor = [UIColor redColor];
UITableViewRowAction *layTopRowAction2 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"标记已读" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
[MessageCenterHttps setAllReadMessage:@{@"systemMsgFlag" : flag, @"accountId" : [kUserDefaults objectForKey:@"loginId"]} view:self.view success:^(BOOL success, NSInteger unReadCount) {
if (success) {
[self loadData];
}
}];
[tableView setEditing:NO animated:YES];
}];
layTopRowAction2.backgroundColor = [UIColor lightGrayColor];
NSArray *arr = @[layTopRowAction1,layTopRowAction2];
return arr;
}
2017年6月22日
1.tableView不显示分割线
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;```
2.cell不需要选择样式
cell.selectionStyle = UITableViewCellSelectionStyleNone;```
2017年6月18日
1.显示右边默认箭头
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; //显示最右边的箭头```
2017年6月15日
1.没有调用reloadData 为什么会执行 cellforrowatindexpath
因为设置了如下row,改成和数据源一致,就不会莫名其妙执行 cellforrowatindexpath
-
(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
if (section == 0) {
return 1;
}else{
NSInteger nRow = _dataArray ? 1 : 0;
return nRow;
}
}
如果您发现本文对你有所帮助,如果您认为其他人也可能受益,请把它分享出去。