I have to add radio buttons in my iPhone application. For that I have got radio button image which is of round in shape. Can I add that image as a subview? and Can I add touchupinside event to UIImage?
iPhone apps do not have radio buttons. The "iPhone-like" way to do this is either by using a picker view or by having several rows in a grouped table view with a check accessory on the chosen row.
Radio buttons allow the user to select one option from a set. You should use radio buttons for optional sets that are mutually exclusive if you think that the user needs to see all available options side-by-side. If it's not necessary to show all options side-by-side, use a spinner instead.
Go to Settings > Accessibility > Touch > AssistiveTouch. Tap Customize Top Level Menu, then tap an icon to reassign a different function to its position. Use the + and - buttons to change the number of buttons that appear in the menu.
iPhone apps do not have radio buttons. The "iPhone-like" way to do this is either by using a picker view or by having several rows in a grouped table view with a check accessory on the chosen row.
If for some reason you really, really feel the need to have radio buttons, use a UIButton with a button type of custom. Set the empty circle as the image for the "normal" control state and the filled circle as the image for the "selected" state.
Try UISegmentedControl. It behaves similarly to radio buttons -- presents an array of choices and lets the user pick 1.
IBOutlet UIButton *checkboxButtonMale;
IBOutlet UIButton *checkboxButtonFmale;
checkboxButtonFmale.tag = 3;
checkboxButtonMale.tag = 2;
(IBAction)checkboxGenderChecked:(id)sender{
UIButton *selectedButton = (UIButton *)sender;
UIButton *toggledButton;
if (selectedButton.tag == 2 ) {
toggledButton = checkboxButtonFmale;
}
else {
toggledButton = checkboxButtonMale;
} [toggledButton setSelected:NO];
[sender setSelected:YES];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With