我在tableVIew單元格中添加圖像,但不顯示。 我正在使用條件來給圖像按鈕,但它不顯示。在TableView Cell中添加圖像不顯示
下面是按鈕addding
addButton = [UIButton buttonWithType:UIButtonTypeCustom];
addButton.Frame=CGRectMake(590,2,42,42);
[addButton addTarget:self action:@selector(tab1Action:) forControlEvents:UIControlEventTouchUpInside];
addButton.tag=indexPath.row;
NSString*test=theData.Status;
if ([test isEqualToString:@"1"]) {
[email protected]"Already Member of the group";
}
else {
[email protected]"";
NSLog(@"Else is also Working Fine");
[addButton setImage:[UIImage imageNamed:@"addbutton.png"] forState:UIControlStateNormal];
}
addButton.clipsToBounds=YES;
[[cell contentView] addSubview:addButton];
cell.textLabel.font=[UIFont fontWithName:@"Helvetica" size:16];
cell.textLabel.text=[NSString stringWithFormat:@"%@: %@",theData.GroupTitle,test];
return cell;
有你有我的觀點? –