iPhone showing checkboxes and radiobuttons
I will have UInavigation controller and UITableView, it will be long scrolling list,for each cell I need to show some radiobuttons. checkboxes, date entries and textboxes. Since Iphone does not have these controls and considerding that I already Use UITableview and UINavigationContoller what is the best and easy practise here to show radiobuttons and checkboxes?
- pickerviews and putting them into a alertshield
- show them as tablelist items an开发者_开发百科d multi/checkable
- using pickerview popping up from bottom as I have seen in some apps but dont know how to do that?
The second choice is probably your best one. Look at how the Settings app lays things out: that should give you a good idea how to organize your options. Checkbox-able items are usually UISwitches; option-button-y ones are usually rows in a table view, with their corresponding UITableViewCell set to use UITableViewCellAccessoryCheckmark
as their accessoryType
if they’re selected.
Radio Buttons: If the user has to select one among many items, you can use UISegmentedControl.
Note: This method won't be a good solution if there are lot of items the user has to choose from.
Check Boxes: You can implement this using UIButtons with some images like check boxes or something, and with some logic.
Note: You can also implement radio buttons in this method.
Checkboxes can be done by subclassing UIControl. For future use I've already done this and all you have to do is download the link below from GitHub. Also includes a sample project on how easy it is to use:
https://github.com/Brayden/UICheckbox
精彩评论