iOS:在XIB中禁用UI镜像 [英] iOS: disable UI mirroring in XIB

查看:111
本文介绍了iOS:在XIB中禁用UI镜像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

iOS 6 中有一个新的功能,如果用户处于从右到左的区域设置(希伯来语,阿拉伯语),则会反映xib文件中的UI元素。
http:// developer .apple.com / library / ios /#documentation / miscellaneous / conceptual / iphoneostechoverview / iPhoneOSTechnologies / iPhoneOSTechnologies.html

in iOS 6 there's a new "feature" that mirrors the UI elements in the xib file if the user is on right-to-left locale (hebrew, arabic). (http://developer.apple.com/library/ios/#documentation/miscellaneous/conceptual/iphoneostechoverview/iPhoneOSTechnologies/iPhoneOSTechnologies.html)

它完全搞砸了我的界面。

It completely messes up my interface.

有没有办法在不禁用自动布局的情况下禁用它?

Is there a way to disable it without disabling auto-layout?

推荐答案

水平约束在Interface Builder中具有方向选项。默认情况下,它设置为导致尾随,从而导致镜像。您可以将其设置为从左到右以禁用镜像。

Horizontal constraints have the "Direction" option in Interface Builder. By default it's set to "Leading to Trailing" which causes the mirroring. You can set it to "Left to Right" to disable the mirroring.

注意,通过编辑storyboard / xib文件来更改所有约束会导致异常或混乱布局,它似乎Interface Builder在更改方向设置时创建/更改了一些额外的约束。

Note, changing all the constraints by editing storyboard/xib files causes exceptions or messed up layout, it seems that Interface Builder creates / changes some additional constraints when changing the direction setting.

因此,我发现更改现有xib / storyboard的更快方法是选择所有使用Leading to Trailing设置的约束,将它们全部更改为从左到右,然后检查是否自动创建了一些新的水平约束 - 它们的方向也应该更改为从左到右。

So the faster way I found to change the existing xib/storyboard, is to select all the constraints with the "Leading to Trailing" set, change them all together to "Left to Right" and then check if some new horizontal constraints were automatically created - their direction should be changed to "Left to Right" as well.

这篇关于iOS:在XIB中禁用UI镜像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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