我正在使用 GSRadioButtonSetController 实现单选按钮...我创建了两个按钮并包含在 IBOutletCollection(UIButton) NSArray *buttonCollection....然后我将 GSRadioButtonSetController.h 和 GSRadioButtonSetController.m 文件包含到我的项目中。然后在我的 viewdidload 中添加
// Instantiate your GSRadioButtonSetController object
self.radioButtonSetController = [[GSRadioButtonSetController alloc] init];
// Set its delegate to your view controller
self.radioButtonSetController.delegate = self;
// Set its buttons property to an array of buttons that you've
// created previously.
self.radioButtonSetController.buttons = buttonCollection;
然后我把
- (void)radioButtonSetController:(GSRadioButtonSetController *)controller
didSelectButtonAtIndex:(NSUInteger)selectedIndex
{
//implemetation
}
按钮有两个图像...一个用于选择状态,第二个用于 deselcetd 状态....代码给了我索引但是我不知道如何动态更改为图像以便用户知道选择了哪个和哪个不是...
提前感谢