隐藏键盘iPhone SDK?
|
我有一个“ 0”。我希望用户点击搜索键后键盘就消失...我确实尝试了
resignFirstResponder
,但这没用。任何帮助,将不胜感激
- (void)viewDidLoad {
[super viewDidLoad];
self.title = NSLocalizedString(@\"Songs\", @\"Search for songs\");
NSMutableArray *array = [[NSArray alloc]initWithObjects: @\"Book_1\", @\"Book 2\", @\"Book _ 4\", nil];
self.booksArray = array;
[array release];
search.delegate=self;
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
}
谢谢
TC
没有找到相关结果
已邀请:
2 个回复
秃拳割
与变量
连接起来。 您没有在代码的任何地方取消引用搜索变量(重新分配它)。 您的
方法与searchBar所在的same6相同。 请NSLog(@ \“ Search Bar Instace:%@ \”,search);在viewDidLoad方法和
中,并验证两个实例是否相同(如果不相同),那么您是
正在代码中的某处重新分配。 就在
NSLog之后(@ \“ isFirstResponder:%d \”,[searchbar isFirstResponder]);和
是
点击键盘的搜索按钮时调用方法?确保在您的keyboard15ѭ后面没有添加键盘
(如
,
或其他
)。请也通过xib检查它。 谢谢,
凡夕
参考:http://www.iphonedevsdk.com/forum/iphone-sdk-development/7148-problem-uisearchbar-navigation-controller.html#post59467