UITableView에서만 UIButton을 indexPath.row로 표시하고 싶습니다.UITableView에 상호 UIButton을 표시하십시오.
그러나 UIButton은 모든 셀에 나타납니다.
if (indexPath.row % 2 == 0) {
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
button.frame = CGRectMake(160, 140, 80, 40);
[button setTitle:@"button" forState:UIControlStateNormal];
[cell addSubview:button];
}
이 문제를 어떻게 해결할 수 있습니까? 감사합니다. .
'[cell.contentView addSubview : button];' – janusbalatbat