开发者

NSButton Aligned to the Right

开发者 https://www.devze.com 2022-12-22 20:45 出处:网络
I want to have a check box, like the standard one (first the check box and on the right its title) but I want it to be aligned from the开发者_Python百科 right. If I change the alignment to the right t

I want to have a check box, like the standard one (first the check box and on the right its title) but I want it to be aligned from the开发者_Python百科 right. If I change the alignment to the right then only the text will move to the right but the button itself will still be at the left.

How would I achieve this without knowing the bounds of the NSButton?


Read about Interface Layout in the Interface Builder user guide. As it turns out, just make your checkbox as big as you need to initially, and then set the struts and springs to make it resize correctly as it changes.

To do the same thing in code, read about the setAutoresizingMask: method in NSView.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号