uipopover hides when keyboard shows

天大地大妈咪最大 提交于 2019-12-13 21:08:24

问题


i have an UIpopover with UItextfield in it, when i open popover and tap on uitextfield then keyboard shows, but it hide the popover. How can i show keyboard without hiding UIpopover?
i am calling popover in UIWebView because i use cordova 1.8.1, but i tried it in UIView too, and it hides too. here code of calling UIpopover :

if (popEl==nil){
    popEl=[[Popover alloc] init];
}
if (pcs==nil){
    pcs=[[UIPopoverController alloc] initWithContentViewController:popEl];
    pcs.delegate=self;
}
[pcs presentPopoverFromRect:CGRectMake(0, 0, 1, 1) inView:self.webView permittedArrowDirections:UIPopoverArrowDirectionUp animated:NO];

P.S. Sorry for my English, i am from Ukraine.


回答1:


firstly i recommend you to go through the apple documentation of UIPopOverController

for your problem i think you have to deal with the appearance and disappearance of Keyboard here's the solution to handle this problem Check it




回答2:


Your question is that, when U click on the textField the pop over view should appear,right? if yes, then add this code before you add the popoverview,

[textField resignFirstResponder];


来源:https://stackoverflow.com/questions/11827363/uipopover-hides-when-keyboard-shows

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