我學習iOS SDK使用this book和4章,當它告訴你如何隱藏數字鍵盤與背景輕拍我有一個問題。我這樣做的作者說,但沒有發生。我如何做到這一點? 什麼書的作者說:如何使用背景隱藏數字鍵盤點擊?
1)ViewController.h
- (IBAction)touchBackground:(id)sender;
2創建新方法backgroundTap)在ViewController.m
-(void)touchBackground:(id)sender{
[nameField resignFirstResponder];
[numberField resignFirstResponder];}
3)查看更改對象的階級身份加入方法在界面生成器(據我所知,在Xcode 4其控制)從UIView到UIControl
4)將事件列表中的TouchDown方法與File' s所有者和檢查方法backgroundTap。
這是我的代碼示例
附:我很抱歉我的英文,因爲我有俄文翻譯,所以我把所有的信息從這本書翻譯成英文。