UITableViewCell of type UITableViewCellStyleValue1 is what is used in the Settings of the iPhone/iPad. I would like to know how to make a UITableViewCell that allows you to edit in-place a secure string (showing dots instead of actual text) in the detailTextLabel similar to the setting of the password field in creat开发者_如何学编程ion of a new email account for the iPhone.
Anyone have any idea how this is done?
Thanks in advance,
Shiun
I would create a custom UITableViewCell
subclass. Place a UITextField
with no border in the cell. Make the cell the text field's delegate so that the cell can handle the case when the user taps and edits the text field. Whenever the user updates the text field, the cell should probably inform the table view controller (through the delegate pattern or a custom notification) so that the view controller can save the new value.
Also, in tableView:didSelectRowAtIndexPath:
, the view controller should bring up the keyboard for the text field (-becomeFirstResponder
).
精彩评论