2
Apple App Store의이 예와 같이 하나의 UITableViewCell에 두 개의 버튼을 어떻게 배치합니까?하나의 UITableViewCell에 두 개의 버튼
Apple App Store의이 예와 같이 하나의 UITableViewCell에 두 개의 버튼을 어떻게 배치합니까?하나의 UITableViewCell에 두 개의 버튼
if ([cell.contentView viewWithTag:kButtonTag] == nil) {
UIButton *btn1 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
btn1.tag = kButtonTag;
UIButton *btn2 = btn1;
[btn1 setTitle:@"Tell a Friend" forState:UIControlStateNormal];
[btn2 setTitle:@"Report a Problem" forState:UIControlStateNormal];
btn1.frame = CGRectMake(0, 0,100,40);
btn2.frame = CGRectMake(120, 0,100, 40);
[cell.contentView addSubview:btn1];
[cell.contentView addSubview:btn2];
[cell setBackgroundColor:[UIColor clearColor]];
}
변경 주위의 프레임, 그리고 유사합니다.