【发布时间】:2017-03-02 04:24:14
【问题描述】:
NSString *cellIdentifier = @"cellID";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (tableView==self.monthTableVW)
{
if (cell == nil)
{
cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
}
cell.textLabel.text=[self.monthArr objectAtIndex:indexPath.row];
cell.backgroundColor=[ UIColor colorWithRed:224.0f/255.0f green:188.0f/255.0f blue:113.0f/255.0f alpha:0.5f];
}
if (tableView==self.attendanceTBVW)
{
customeCell *cell1=[[customeCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellIdentifier];
cell1=[tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if(cell==nil)
{
NSArray *cellArr=[[NSBundle mainBundle]loadNibNamed:@"customeCell" owner:self options:nil];
cell=[cellArr objectAtIndex:0];
}
cell1.dateLbl.text=[self.monthArr objectAtIndex:indexPath.row];
}
return cell;
}
我需要一个表格视图用作下拉菜单,第二个是显示数据,即出席TBVW,即customCell。
【问题讨论】:
标签: objective-c uitableview custom-cell