4
A
回答
7
如果你想完全相同的行爲,沒有鍵盤,嘗試
textfield.inputView = [[[UIView alloc] initWithFrame:CGRectZero] autorelease];
6
返回否UITextFieldDelegate
的- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField
應該這樣做。
0
我覺得你可以在委託方法使用
textfield resignFirstResponder
-
(void)textFieldDidBeginEditing:(UITextField *)
textField like這樣的:
-(void)textFieldDidBeginEditing:(UITextField *)textField
{
if (textField == yourTextField){
[yourTextfield resignFirstResponder];
}
}
0
使用這種方法通過點擊鍵盤完成按鈕
-(BOOL)textFieldShouldReturn:(UITextField *)textField
{
[textField resignFirstResponder];
return YES;
}
相關問題
- 1. 小鍵盤隱藏UITextField
- 2. 隱藏在鍵盤後面的UITextField
- 3. UITextField失去焦點時隱藏鍵盤
- 4. 鍵盤在swift中隱藏UITextField
- 5. Swift 3禁用或隱藏鍵盤UITextField
- 6. Swift 3.0 - 隱藏多個UItextfield的鍵盤
- 7. 隱藏鍵盤
- 8. 隱藏IOS鍵盤
- 9. 鍵盤隱藏BottomSheetDialogFragment
- 10. 鈦 - 隱藏鍵盤
- 11. 隱藏軟鍵盤
- 12. 在UITextField中按下清除按鈕時隱藏鍵盤
- 13. 即使在uitextfield是firstresponder時如何隱藏鍵盤?
- 14. UITextfield的清除按鈕隱藏鍵盤時,其內部UIScrollView
- 15. iPhone:點擊UITextField時是否可以隱藏鍵盤?
- 16. 如何禁用UITextField鍵盤而不隱藏它?
- 17. 鍵盤隱藏UITextField如何解決這個問題?
- 18. 檢測UITextField上的觸摸NOT(使鍵盤隱藏)
- 19. 鍵盤與UITextField
- 20. 等待鍵盤隱藏
- 21. uipopover隱藏鍵盤顯示
- 22. becomeFirstResponder不隱藏鍵盤
- 23. Android鍵盤隱藏LinerLayout
- 24. 隱藏鍵盤/ resignFirstResponder強制
- 25. 在AlertDialog中隱藏鍵盤
- 26. 用dismissViewControllerAnimated隱藏鍵盤
- 27. 在UIWebView中隱藏鍵盤
- 28. 鍵盤隱藏的TabBar
- 29. 軟鍵盤隱藏的EditText
- 30. 在android中隱藏鍵盤?
這是愚蠢的,但如何在
或 駁回鍵盤觸摸視圖中的任何地方我該怎麼辦這個? – user648244 2011-03-29 21:43:25
這很簡單,你的viewController應該是textfield的委託(你可以在界面生成器中做到這一點),然後你只需在你的viewController中實現該函數並返回NO。我希望這有幫助! – 2011-05-16 10:14:46