Commit eabddaa1 authored by admin's avatar admin

bug修复

parent ce9164a1
...@@ -456,10 +456,12 @@ ...@@ -456,10 +456,12 @@
#pragma mark - TableView Delegate/DataSource #pragma mark - TableView Delegate/DataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{ {
if (_titleArray.count == 6) { if (_titleArray.count == 1) {
return 3;
} else {
return _titleArray.count; return _titleArray.count;
} else if (_titleArray.count == 5){
return 2;
} else {
return 3;
} }
} }
...@@ -467,6 +469,14 @@ ...@@ -467,6 +469,14 @@
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{ {
if (_titleArray.count == 5) {
if (section == 0) {
return _taskListDataArray.count;
} else {
return _allQuestionArray.count;
}
} else {
if (section == 0) { if (section == 0) {
return _taskListDataArray.count; return _taskListDataArray.count;
...@@ -477,15 +487,40 @@ ...@@ -477,15 +487,40 @@
return _allQuestionArray.count; return _allQuestionArray.count;
} }
}
} }
// cell显示的内容
// cell显示的内容 // cell显示的内容
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{ {
if (_titleArray.count == 5) {
if (indexPath.section == 0) {
InspectListCell *cell=[tableView dequeueReusableCellWithIdentifier:kHomeInspectListCell];
if (!cell) {
cell = [[InspectListCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kHomeInspectListCell];
}
TaskListModel *taskList = _taskListDataArray[indexPath.row];
cell.taskList = taskList;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.allView.backgroundColor = kProgressViewAllBackColor;
UIImage *image = [UIImage imageNamed:@"progress-bar"];
image = [image resizableImageWithCapInsets:UIEdgeInsetsZero resizingMode:UIImageResizingModeTile];
cell.alreadyView.image = image;
return cell;
} else {
// 问题与知识
QuestionListTableCell *cell = [tableView dequeueReusableCellWithIdentifier:kHomeQuestionListTableCell];
if (!cell) {
cell = [[QuestionListTableCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kHomeQuestionListTableCell];
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
QuestionModel *question = _allQuestionArray[indexPath.row];
cell.question = question;
return cell;
}
} else {
if (indexPath.section == 0) { if (indexPath.section == 0) {
InspectListCell *cell=[tableView dequeueReusableCellWithIdentifier:kHomeInspectListCell]; InspectListCell *cell=[tableView dequeueReusableCellWithIdentifier:kHomeInspectListCell];
if (!cell) { if (!cell) {
...@@ -539,6 +574,9 @@ ...@@ -539,6 +574,9 @@
} }
}
} }
// if ([title isEqualToString:@"口碑排名"]) { // if ([title isEqualToString:@"口碑排名"]) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment