我知道的Xcode没有单选按钮添加单选按钮泰伯维了一些问题
所以我尝试添加自定义按钮,使它像一个单选按钮
行动这是我使用的图像
,这是我设置到小区
UIButton *but = [UIButton buttonWithType:UIButtonTypeCustom];
[but setImage:[UIImage imageNamed:@"radio-off.png"] forState:UIControlStateNormal];
[but setImage:[UIImage imageNamed:@"radio-on.png"] forState:UIControlStateSelected];
[but setFrame:CGRectMake(0, 0, 44, 44)];
[but addTarget:self action:@selector(radioButton:) forControlEvents:UIControlEventTouchUpInside];
cell.accessoryView= but;
的代码和该是我要问的问题是
我怎么可以给- (IBAction)radioButton:(UIButton *)button
的空隙来控制两个单选按钮两行
如果第1行的单选按钮的选择是YES
在BTN行2将btn.state=NO
并且不会响应
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
这将是这样的PIC
如何设置,如果在- (IBAction)radioButton:(UIButton *)button
的这张照片是假的条件......我只添加单元格中的按钮...并改变文字颜色
非常感谢所有堆栈溢出朋友〜
你知道的TableView可以管理本地检查单元格:http://developer.apple.com/library/ios/#documentation/UserExperience/Conceptual/TableView_iPhone/TableViewStyles/TableViewCharacteristics。html#// apple_ref/doc/uid/TP40007451-CH3-SW4 – 2010-11-18 10:25:41
我知道......但是我的老板坚持这样看起来更好......所以你知道...... – 2010-11-18 10:34:36