Add UIButton Icon?
image http://img809.imageshack.us/img809/8529/uibutton.png
I would like to implement something as shown on the picture. It would bring up a pickerView when it's tapped and write the chosen value onto it.
U开发者_Go百科IButton or TableViewCell?
There are several ways to go about this and you will have to use the UITableViewCellStyleValue1
style of UITableViewCell
to have a detailTextLabel
You can set
cell.detailTextLabel.text = @"Pick a date & time"; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
Now in the
didSelectRowAtIndexPath
, upon touch you can modally show auipickerView
.You can use
cell.accessoryType = UITableViewAccessoryTypeDisclosureIndicator;
and add a textField as a subview to thecell.contentView
and settextField.placeholder = @"Pick a date & time"; textField.inputView = myPickerView;
Create a button and put a label on it.Whenever picker value changed, change the text of label.
I thinks it's
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
精彩评论