|
|
#1 |
|
[iPhone] How to set focus to a specific GUI element?
I'd like to set focus to a UITextField control (enforce editing mode) just after loading a window (view). Is it possible? I've done some google and apple's doc searching but with no luck
|
|
|
|
0
|
|
|
#2 |
|
|
0
|
|
|
#3 |
|
Thank you for a quick answer. My text field gets focus, however the screen keyboard doesn't apear
. I also tried overriding the following method in my view controller, with no success:Code:
- (void)viewWillAppear:(BOOL)animated {
[fldKeyword becomeFirstResponder];
}
|
|
|
|
0
|
|
|
#4 | |
|
Quote:
Code:
[fldKeyword becomeFirstResponder]; [self.view addSubview:fldKeyword]; |
||
|
|
0
|
|
|
#5 |
|
I assume that loadView() is an overridden method of your View that you created programatically. Is it possible to do the same trick with the Interface Builder, where the UIView class and its instance is created by IB, not programatically? (and only the view controller is available for me from Xcode)
|
|
|
|
0
|
|
|
#6 | |
|
Quote:
Declare a property in your View controller as an IBOutlet IBOutlet UITextField *myFirstFocusField; In Interface builder, drag an association from the text field you want to have the first focus, to Files Owner and associate with "myFirstFocusField" That will give you the association you want, so you can use the line of code [myFirstFocusField becomeFirstResponder]; in your viewDidLoad method. You don't need to do the addsubview line as that's all taken care of. |
||
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| thread | Thread Starter | Forum | Replies | Last Post |
| iTunes: How to retain "date added" when moving content from internal to external HDD? | jayrio | Mac Applications and Mac App Store | 11 | Mar 22, 2013 05:40 AM |
| How to supercharge Mini? | ranny2 | Mac mini | 18 | Oct 27, 2011 08:53 PM |
| How To Remove Server Part Of Lion? | hhaydenn | iMac | 2 | Aug 18, 2011 05:21 PM |
| How to set Itunes to allow user to browse for a selected Iphone FW | kpham | iPhone | 1 | Jul 28, 2008 05:47 PM |
| quick iTunes question - how to bring focus to library? | ero87 | Mac Applications and Mac App Store | 2 | Feb 12, 2007 06:29 PM |
All times are GMT -5. The time now is 12:43 AM.







Linear Mode

