문제

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".

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

Is this documented anywhere?

도움이 되었습니까?

해결책

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];
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top