1

我的应用程序中有一个搜索栏,但它仅在alertViewShow. 我已经实现了委托的所有方法:shouldChangeTextInRange,,,searchBarShouldEndEditingsearchBarShouldBeginEditing

状态栏没问题...知道出了什么问题吗?

  -(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];
4

1 回答 1

0

我错过了 appDelegate ,applicationDidFinishLauching下面的代码

 self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
[self.window makeKeyAndVisible];

现在 SearchBar 工作正常!

于 2013-01-04T16:52:43.290 回答