开发者

UIWebView keyboard with modal view dismissal, display issue

i have a UIWebView on a modal view. The problem is that when the keyboard comes up for the UIWebView and I then dismiss the modal view, the underlying UINavigationController which has a UITableView on a UIScrollView will not display properly. it looks like the entire view(now sure if it's the table view or the scroll view) is shifted down to the middle of the screen. this only occurs if the web view keyboard comes up. it does not happen any other time. i can dismiss the modal view and it will display the underlying view fine, provided the web view keyboard is never initiated.

once that underlying view is up all i have to do is tap the screen and it goes back to where it should be.

i've tried to get the view开发者_开发百科 to refresh with a

[self.view setNeedsDisplay];

and that didn't do anything for it.

then i tried this to reset them back to their starting positions

myTableView.contentInset = UIEdgeInsetsMake(18, 0, 0, 0);
scrollView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0);

and that didn't work.

is there another way to get the underlying view to redraw? both the tableview and the scollview have paging enabled. there are other modal views that do not cause any issues when dismissing to this same view controller. i'm not hiding any navigation bars or anything like that.

thanks guys, any help is greatly appreciated! Dennis


I can't say I know for certain why your table moves, but it's odd to put a table in a scroll view, since UITableView is a scroll view. I'd suggest ditching the scroll view if possible. Also, if you haven't already tried it, make sure that you dismiss the keyboard before you dismiss the modal view. You can do that by having the web view -resignFirstResponder.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜