码迷,mamicode.com
首页 > 移动开发 > 详细

ios UISearchBar 自动获取焦点

时间:2016-08-17 12:13:58      阅读:1938      评论:0      收藏:0      [点我收藏+]

标签:

 

@property (weak, nonatomic) IBOutlet UISearchBar *searchBar;

 

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self performSelector:@selector(setCorrectFocus) withObject:NULL afterDelay:0.8];
}

 

-(void) setCorrectFocus {
    [self.searchBar becomeFirstResponder];
}

 

ios UISearchBar 自动获取焦点

标签:

原文地址:http://www.cnblogs.com/codemakerhj/p/5779191.html

(0)
(1)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!