弹出窗口不规则地调整大小
我在 UIPopoverController 中有一个 UITabBarController,我仅从一个 UIBarButtonItem 显示它。显示时,我希望弹出窗口占据允许的最大垂直高度。如果我点击显示它,然后关闭,然后旋转,效果很好。但是,如果我将弹出框以横向显示,然后旋转到纵向,它不再会填充整个垂直距离。我将选项卡栏控制器的内容大小属性设置为 320 x 1000,我什至尝试在每次设备旋转时重置它。更糟糕的是,当用户激活搜索栏时,弹出窗口会缩小得非常小,并保持这种状态直到应用程序重新启动。
http://cl.ly/3JdC 到 http://cl.ly/3JdC
我怎样才能阻止这个,并使弹出窗口始终填满最大垂直尺寸?
I have a UITabBarController inside a UIPopoverController, which I am displaying solely from one UIBarButtonItem. When shown I want the popover to take up the maximum vertical height allowed. It works fine if I tap to display it, then dismiss, and then rotate. However if I have the popover displayed in landscape, and then rotate to portrait, it no longer will fill the entire vertical distance. I have the tab bar controller's content size property set to 320 by 1000, and I have even tried resetting this every time the device rotates. Worse yet, when the user activates the search bar the popover shrinks up extremely small, and stays that way until the app is restarted.
http://cl.ly/3JdC to http://cl.ly/3JdC
Also http://cl.ly/3JVF
How can I stop this, and have the popover always fill up the max vertical size?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我遇到了同样的问题,发现只有当我使用该方法呈现
UIPopoverController
时才会发生这种情况:但当我使用时它工作正常:
不幸的是
UIBarButtonItem
没有您可以与最后一个方法一起使用的框架矩形,因此我的解决方法是使用 UIToolbar 的框架并修改frame.origin.x 和frame.size。 width 相应地使弹出窗口出现在 UIBarButtonItem 旁边的正确位置。希望苹果能够在下一版本的 iOS 中修复这个问题。
问候
I was just having the same problem and found out that it only happens when I present the
UIPopoverController
using the method:but it works fine when I use:
Unfortunately
UIBarButtonItem
does not have a frame Rect you can use with this last method so my fix was to use theUIToolbar
's frame and modifyframe.origin.x
andframe.size.width
accordingly to make the popover appear on the right place next to the UIBarButtonItem.Hopefully Apple will fix this in next releases of iOS.
Regards