UIToolbar和Flexable /固定栏按钮项目 [英] UIToolbar and Flexable/Fixed bar button items

查看:326
本文介绍了UIToolbar和Flexable /固定栏按钮项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个工具栏,在这里我想有一个的UIBarButtonItem 为中心,并在最右边有另一个。然而,当我加入右侧的按钮,我的心按钮被进一步向左偏移(见附件​​)。我无法弄清楚如何获得这个解决,而无需使用code(我想只使用界面生成器)。任何想法?

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?

推荐答案

要做到这一点,在短短IB,固定栏按钮项添加到最左边栏是这样的切换相机按钮完全相同的宽度,其次是灵活的按钮,你的摄像头图标,另一个灵活的空间,并且开关摄像头。

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|

这篇关于UIToolbar和Flexable /固定栏按钮项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆