【发布时间】:2014-11-28 10:38:23
【问题描述】:
我有关于部分图像的图像问题,当我展开单元格时,它会在随机行中显示图像...
我必须在部分中显示图像视图
图片 + 部分中的部分名称
我的问题是图像显示在 Some random Row's ...
这是我的代码哪里错了??
if (!indexPath.row)
{
// first row
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
{
client_Image = [[UIImageView alloc] initWithFrame:CGRectMake(10,10,50,50)];
client_Image.image = [UIImage imageNamed:@"mdclogo.png"];
[cell addSubview:client_Image];
cell.textLabel.text =[NSString stringWithFormat:@" %@",tclient.clientName];
UIFont *fontBold = [UIFont fontWithName:@"Arial Rounded MT Bold" size:30];
cell.textLabel.font = fontBold;
cell.textLabel.textColor = [UIColor blackColor];
}
else
{
cell.textLabel.text = [NSString stringWithFormat:@" %@",tclient.clientName];
UIFont *fontBold = [UIFont fontWithName:@"Arial Rounded MT Bold" size:20];
cell.textLabel.font = fontBold;
cell.textLabel.textColor = [UIColor blackColor];
client_Image = [[UIImageView alloc] initWithFrame:CGRectMake(5,5,39,36)];
client_Image.image = [UIImage imageNamed:@"mdclogo.png"];
[client_Image setClipsToBounds:YES];
[cell addSubview:client_Image];
cell.layer.cornerRadius = 0.5f;
cell.layer.masksToBounds = YES;
}
// only top row showing
if ([expandedSections containsIndex:indexPath.section])
{
cell.accessoryView = [DTCustomColoredAccessory accessoryWithColor:[UIColor grayColor] type:DTCustomColoredAccessoryTypeUp];
}
else
{
cell.accessoryView = [DTCustomColoredAccessory accessoryWithColor:[UIColor grayColor] type:DTCustomColoredAccessoryTypeDown];
}
}
else
{
// all other rows (client flows)
cell.textLabel.text = ((MDCFlowDetails * )[tclient.aflows getFlow:indexPath.row - 1]).title;
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
{
cell.indentationWidth = 2;
UIFont *fontBold = [UIFont fontWithName:@"Arial" size:25];
cell.textLabel.font = fontBold;
cell.accessoryView = nil;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
else
{
cell.indentationWidth = 2;
UIFont *myFont = [UIFont fontWithName:@"Arial" size: 16.0 ];
cell.textLabel.font = myFont;
cell.accessoryView = nil;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
}
【问题讨论】:
标签: ios objective-c uitableview ios7 ios8