UIToolbar not positioned at the bottom on device but appears ok in storyboard

冷暖自知 提交于 2020-01-07 07:59:14

问题


I'm testing the new universal storyboard in XCode 6. I basically created a view with a toolbar positioned at the bottom. When I run that basic example in the iPad the toolbar is not at the bottom

And here is in the storyboard

How can I place the UIToolbar at the bottom and using all the available width for all different screens?


回答1:


Use Autolayout. Set the left margin, right margin and bottom space constraints on the toolbar to make it dock at the bottom. Optionally, add a height constraint if you want the toolbar height to be something other than the standard 44.

Your constraints on your toolbar in the storyboard should look like this:

1:



来源:https://stackoverflow.com/questions/31987104/uitoolbar-not-positioned-at-the-bottom-on-device-but-appears-ok-in-storyboard

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