【发布时间】:2010-10-25 18:49:41
【问题描述】:
就在我以为我已经弄清楚了一切时..我遇到了这个问题。
场景。
我有一个简单的 tableView。并在导航项的 titleView 中有一个搜索栏。 SearchBar 通过视图控制器工具栏中的 uibarbuttonitem 添加到 navItems titleView。
现在,正常
使用 [beginResponder] 启动搜索栏后,键盘会出现。它会发出一个通知“KeyboardDidShow”,我在这里计算 UIKeyboard 的高度并相应地设置 tableView 的高度(缩短它)。
ON Rotation - 来回横向/纵向,一切正常。 -(void)didRotateInferfaceOrientation 被调用,一切都很好。
问题来了。
当键盘处于活动状态时,它有一个谷歌“搜索”按钮,这会推送到一个新视图 - webviewcontroller。
问题是,这个
当 [PORTRAIT]ViewController [SearchBar with keyboard active] --> 点击 Search --> [Portrait]WebViewController --> 将设备方向更改为 [Landscape] --> [Landscape]WebViewController 更改为横向 --- > 问题出在这里,用户点击返回 uiViewController[Landscape]
方法 -didRotatefromInterfaceOrientation 未被调用。不知何故,tableView 的高度搞砸了。虽然视图完美旋转。
这里有什么我缺少的吗..
将不胜感激。 .谢谢
【问题讨论】:
标签: iphone interface ios orientation device