Have UITextField show keyboard (becomeFirstResponder) when UIView is shown?

In your subclass of UITableViewSource or UITableViewDelegate try overriding WillDisplay method, like this.

In your subclass of UITableViewSource or UITableViewDelegate try overriding WillDisplay method, like this: public override void WillDisplay (UITableView tableView, UITableViewCell cell, NSIndexPath indexPath) { if(indexPath. Row == theRowIndexOfTheCellWithYourTextField){ yourTextField. BecomeFirstResponder(); } } It should work (note that you probably wish to add some code to make sure this is executed only once).

In your viewdidload, put this: yourTextField becomeFirstResponder; I am not sure at all is this works :S please tell if it does/don't :).

No, it doesn't work. I first check if CanBecomeFirstResponder by the way. The problem I believe is that the UITableView hasn't populated its rows yet.

– Neal Dec 9 '10 at 19:30.

You can try setting up a notification for when your cell view is loaded or appeared. Then you can call the becomeFirstResponder on the field after the notification is fired off.

First of all, always use a UITableViewController derived class instead of a UIViewController when working with a UITableView. This will help you to resize the view, and makes sure fields are visible when the keyboard is shown. You can show the keyboard for the first field by calling BecomeFirstResponder in the ViewDidAppear event.

Example: public class YourTableViewController : UITableViewController { private UITableView _yourTableView; YourUITableViewSourceDerivedClass _yourSource; public override void ViewDidLoad() { _yourTableView = new UITableView(View. Bounds, UITableViewStyle. Plain); _yourTableView.

AutoresizingMask = UIViewAutoresizing. FlexibleHeight; _yourSource = new YourUITableViewSourceDerivedClass(); _yourTableView. Source = _yourSource; TableView = _yourTableView; } public override void ViewDidAppear(bool animated) { // Well, of course you call a method in your source to do this, but this is the idea: _yourSource.

TextFieldOnFirstRow. BecomeFirstResponder(); } }.

I've summed up the response on my blog if you're interested: bcaccinolo.wordpress.com/2010/12/28/uite....

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions