Fixed keyboard inside a UIView

时光怂恿深爱的人放手 提交于 2019-12-08 04:11:19

问题


Is there a way to include a keyboard inside of a view? I want it to be part of the view and not be dismissed as well.

Birdfeedapp does this in it's 'add account' modal view.


回答1:


Simply just add this code to your view. This will show the keyboard:

-(void) viewDidAppear:(BOOL)animated{
   [super viewDidAppear:animated];
   [YOURTEXTVIEW becomeFirstResponder];
}



回答2:


Either make a text field as the first responder and keep it the first responder or create your own keyboard.



来源:https://stackoverflow.com/questions/1103040/fixed-keyboard-inside-a-uiview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!