我的应用程序中有一个搜索栏,但它只能在alertViewShow
之后运行(显示我的数字)。我已经实现了代理中的所有方法:shouldChangeTextInRange
,searchBarShouldEndEditing
,searchBarShouldBeginEditing
状态栏没问题......对于出了什么问题有什么想法吗?
-(IBAction)btnSearchClick:(id)sender {
if (!searchBarVisivel) {
[searchBar setHidden:NO];
searchBarVisivel = YES;
}
else
{
searchBarVisivel = NO;
[searchBar setHidden:YES];
[searchBar resignFirstResponder];
}
}
//搜索栏出现,当我触摸搜索栏的文本字段时,键盘出现,但是当我数字...没有...
当我调用其他提醒消息的事件时......搜索栏会在...之后工作。
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Alert"
message:@"Alert message"
delegate:self
cancelButtonTitle:@"Não"
otherButtonTitles:@"Sim",nil];
[alert show];
答案 0 :(得分:0)
我在appDelegate错过了以下代码, applicationDidFinishLauching
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
[self.window makeKeyAndVisible];
现在SearchBar工作正常!