本文介绍了改变披露三角形的方向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何以编程方式更改公开三角形的方向?
在Interface Builder中,可以通过从从左到右或从右到左改变值Control - > Layout。

How can I change the direction of the disclosure triangle programmatically?In Interface Builder it's possible by changing the value "Control -> Layout" from "Left to Right" or "Right to Left".

diff的NIB文件。唯一的变化是 NSCellFlags2

I made a diff of a NIB file. The only change was NSCellFlags2.

这是记录在任何地方吗?

Is this documented anywhere?

推荐答案

您正在寻找的方法是 - [NSCell setUserInterfaceLayoutDirection:] 。您需要获取对相应单元格的引用,然后向其发送相应的消息。例如,考虑 disclosureButton 指向该公开按钮:

The method you’re looking for is -[NSCell setUserInterfaceLayoutDirection:]. You need to obtain a reference to the corresponding cell and then send it the appropriate message. For example, considering disclosureButton points to that disclosure button:

[[disclosureButton cell] setUserInterfaceLayoutDirection:NSUserInterfaceLayoutDirectionRightToLeft];

这篇关于改变披露三角形的方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 05:22