NSTextField: do not strip trailing spaces while center-aligned

大城市里の小女人 提交于 2019-12-04 06:24:18

问题


My crusade against static text NSTextField goes on.

The question for today is: Why do center-aligned NSTextField-s even dare to strip trailing spaces from the lines they are given? Why don`t they strip leading spaces then?

But, most importantly, how do I stop them from butchering my text?

P.S.: if you`re wondering why I want that, refer to this question of mine.

P.S.#2: seems like a similar question has been asked before — to no avail, though.


回答1:


Based on a quick experiment: Select the label field and in the attributes pane change the Layout from Truncates to Scrolls the text should now centre taking into account the trailing spaces.

Or you can start with an editable text field and turn off the border, draws background and editable behavior settings.

HTH



来源:https://stackoverflow.com/questions/53385139/nstextfield-do-not-strip-trailing-spaces-while-center-aligned

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