UIToolbar 在屏幕顶部时无法正确旋转
当我的 UIToolbar 放置在屏幕顶部时,它无法正确旋转。旋转时,它会旋转出屏幕。然而,当我将它放在屏幕底部时,它工作得很好。还有其他人有解决这个问题的方法吗?我为此烦恼的唯一原因是因为我正在制作一个网络浏览器,并且地址栏通常位于屏幕顶部,但 UINavigationBar 中仅限于两个对象(后退按钮、文本字段、转发、刷新等)。有什么想法吗?感谢您的帮助!
My UIToolbar doesn't rotate correctly when it's placed at the top of the screen. When rotated, it rotates out of the screen. However, when I place it at the bottom of the screen, it works fine. Does anyone else have a solution to this problem? The only reason I'm bothering with this is because I'm making a web browser and usually the address bar is at the top of the screen, but you're limited to only two objects in a UINavigationBar (back button, text field, forward, refresh, etc). Any ideas? Thanks for your help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
谁说
UINavigationBar
中只能使用两个对象?您可以设置leftBarButtonItem
&任何自定义视图的rightBarButtonItem
属性。如果您需要更多按钮,您可以创建一个带有UIToolbar
的 UIBarButtonItem 作为自定义视图,并根据需要向UIToolbar
添加任意数量的按钮。Who says you are limited to only two objects in the
UINavigationBar
? You can set theleftBarButtonItem
&rightBarButtonItem
properties to any custom view. If you need more buttons, you can create a UIBarButtonItem with aUIToolbar
as a custom view, and add as many buttons to theUIToolbar
as you want.