如何設置我的firstViewController特定的UITextField當我secondViewController從navigationController彈出集中?將焦點設置secondViewController
0
A
回答
1
寫[TexfieldName becomeFirstResponder];
在viewDidLoad中的secondViewController。
這將專注於特定的文本框,並顯示鍵盤。
0
如果你不想使用viewWillAppear:
,你可以使用UINavigationControllerDelegate
方法– navigationController:willShowViewController:animated:
,並改爲調用你的方法。
只要確保某個類是您的導航控制器的delegate
,並讓它調用firstViewController
調用becomeFirstResponder
的方法。
編輯:鏈接到UINavigationControllerDelegate蘋果文檔。
相關問題
- 1. 將焦點設置爲PanoramaItem
- 2. 將焦點設置爲UITabBarItem
- 3. Angularjs設置焦點
- 4. jQuery |將焦點設置爲輸入(固定焦點)
- 5. SAPUI5將焦點設置輸入字段
- 6. 將焦點設置文本框在WPF
- 7. 將焦點設置到其他控件
- 8. 將焦點設置到DataGridView行
- 9. 如何將焦點設置控制
- 10. 將焦點設置爲IE中的iFrame
- 11. 將焦點設置爲jHtmlArea jQuery插件
- 12. 將焦點設置EditText上的Android
- 13. 將焦點設置爲iframe內容
- 14. 將焦點設置爲文本字段
- 15. 將焦點設置爲ContentPresenter的內容
- 16. 將焦點設置爲驗證摘要?
- 17. 將焦點設置到uifigure窗口
- 18. Jquery - 將焦點設置到窗口
- 19. 將焦點設置爲超鏈接
- 20. 如何將焦點設置爲materialUI TextField?
- 21. 將焦點設置爲特殊組件
- 22. 將焦點設置Excel應用程序
- 23. 將焦點設置爲嵌入式MSHTML
- 24. 將焦點CSS屬性設置爲div
- 25. 將焦點設置爲.NET UserControl ...?
- 26. C#將焦點設置文本框
- 27. 將焦點設置在導航欄上
- 28. 在ASP中設置焦點
- 29. 設置焦點在android
- 30. Caliburn.Micro ShowPopup - 設置焦點
我不想將焦點設置到它的視圖加載時。但只有當我的secondViewController彈出。 – John
然後使用viewWillAppear中 – iProgrammer
我不能這樣做,因爲它會影響其他的東西。我只希望它能夠在我的secondViewController彈出時特別設置焦點。我的意思是,在我的secondViewController彈出之前(firstViewController將會顯示),我需要將焦點設置在FirstViewController中的UITextField上。 – John