UIToolbar and Flexable/Fixed bar button items

好久不见. 提交于 2019-12-24 02:18:17

问题


I have a toolbar, where I want to have one UIBarButtonItem centered and have another on the very right. However when I add the button on the right, my centered button gets shifted further to the left (see attached). I can't figure out how to get this resolved without using code (I would like to use interface builder only). Any ideas?


回答1:


To do this in just IB, add a fixed bar button item to the very left of the bar that's the exact same width of the 'switch camera' button, followed by a flexible button, your camera icon, another flexible space, and the switch camera.

So it would look like:

|--fixed space--||--flexible space--||Camera Button||--flexible space--||switch camera|


来源:https://stackoverflow.com/questions/5606903/uitoolbar-and-flexable-fixed-bar-button-items

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