Commit eabddaa1 authored by admin's avatar admin

bug修复

parent ce9164a1
......@@ -456,10 +456,12 @@
#pragma mark - TableView Delegate/DataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
if (_titleArray.count == 6) {
return 3;
} else {
if (_titleArray.count == 1) {
return _titleArray.count;
} else if (_titleArray.count == 5){
return 2;
} else {
return 3;
}
}
......@@ -467,6 +469,14 @@
- (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) {
return _taskListDataArray.count;
......@@ -477,68 +487,96 @@
return _allQuestionArray.count;
}
}
}
// cell显示的内容
// cell显示的内容
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.section == 0) {
InspectListCell *cell=[tableView dequeueReusableCellWithIdentifier:kHomeInspectListCell];
if (!cell) {
cell = [[InspectListCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kHomeInspectListCell];
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;
}
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 if (indexPath.section == 1) {
if (indexPath.row == 0) {
HomeTitleTableCell *cell=[tableView dequeueReusableCellWithIdentifier:kHomeTitleTableCell];
} else {
if (indexPath.section == 0) {
InspectListCell *cell=[tableView dequeueReusableCellWithIdentifier:kHomeInspectListCell];
if (!cell) {
cell = [[HomeTitleTableCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kHomeTitleTableCell];
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 if (indexPath.section == 1) {
if (indexPath.row == 0) {
HomeTitleTableCell *cell=[tableView dequeueReusableCellWithIdentifier:kHomeTitleTableCell];
if (!cell) {
cell = [[HomeTitleTableCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kHomeTitleTableCell];
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
} else {
RankingListCell *cell = [tableView dequeueReusableCellWithIdentifier:kHomeRankingListCell];
if (!cell) {
cell = [[RankingListCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kHomeRankingListCell];
}
cell.rankList = _allRankListArray[indexPath.row - 1];
cell.gradeImageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"medal_0%d", (int)indexPath.row]];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
} else {
RankingListCell *cell = [tableView dequeueReusableCellWithIdentifier:kHomeRankingListCell];
// 问题与知识
QuestionListTableCell *cell = [tableView dequeueReusableCellWithIdentifier:kHomeQuestionListTableCell];
if (!cell) {
cell = [[RankingListCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kHomeRankingListCell];
cell = [[QuestionListTableCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kHomeQuestionListTableCell];
}
cell.rankList = _allRankListArray[indexPath.row - 1];
cell.gradeImageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"medal_0%d", (int)indexPath.row]];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
QuestionModel *question = _allQuestionArray[indexPath.row];
cell.question = question;
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;
}
}
// 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