NSAlert for right to left languages (reversed layout)

こ雲淡風輕ζ 提交于 2019-12-12 04:53:53

问题


I want to create localized NSAlert for right to left language like Arabic and Hebrew.

How can I reverse the layout so that Icon is on the right, TextField on the left, and also buttons start from the left side of the alert?

I can't seem to find the proper answer anywhere.

Thanks, N


回答1:


Apple has a Human Interface Guidelines that are somewhat strict about the ordering & placement of things. For example, in the "Place buttons appropriately" section of this HIG documentation, buttons most likely to be touched usually go on the right.

If NSAlert behavior doesn't look right to you, the easiest way to rearrange things is to implement your own NSView customized to look like a NSAlert. But if Apple hasn't changed the order of things for Right-to-Left languages, then it's a pretty safe bet that most of your Arabic & Hebrew customers are going to be expecting their buttons to be placed in the same place where all other apps are going to have their buttons placed. That is, the button that's most likely to be touched should still be in the bottom right.



来源:https://stackoverflow.com/questions/26782602/nsalert-for-right-to-left-languages-reversed-layout

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