开发者

textfield selected by default-iphone

开发者 https://www.devze.com 2023-03-01 21:46 出处:网络
I want that my textfield must be focused when i open the login page in iPhone. Please help开发者_运维百科.- (void)viewWillAppear:(BOOL)animated {

I want that my textfield must be focused when i open the login page in iPhone. Please help开发者_运维百科.


- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [textfield becomeFirstResponder];
}


In your viewDidLoad function for that page, call setFirstResponder on your textfield, that should do it.


simply take an outlet for the textfeild and write a line like [textfeildstate becomesfirstResponder]; whenever the view launches..


Just write code in viewwillAppear [textField becomeFirstResponder] and you work is done ..


For all those who are still searching. Use

    [textfield becomeFirstResponder]
0

精彩评论

暂无评论...
验证码 换一张
取 消