I am in开发者_如何学Cterested in creating a form in an iphone application similar to this one. Mine would probably have a textbox as well but I was wondering what kind of control(s) should I use? Is this a grouped UITableView where the cells are hardcoded? If that's the case what about events on the textboxes? will they still fire on the tableview level.
Thanks a lot.
Yes, you should use a grouped UITableView. From there you need to create UITextFields and add them to your table view cells. You can either create your own cell, by subclassing UITableViewCell, or you can simply add text fields in cellForRowAtIndexPath.
Then, to receive events from the text fields you need to set the delegate and use the UITableViewDelegate methods mentioned here.
https://developer.apple.com/library/ios/#documentation/UIKit/Reference/UITextFieldDelegate_Protocol/UITextFieldDelegate/UITextFieldDelegate.html
There is an UICatalog sample code in apple develop site, you can check that out.
精彩评论