开发者

Send IB object to back programmatically

I have seen the iPhone e开发者_JAVA百科quivalent of this question here and I'm wondering... is there an equivalent for bringSubviewToFront: for OS X development? I need something to send an NSImageView "to front".


Send IB object to back programmatically

Interface Builder has no relevance here. Views and other UI objects in Cocoa behave the same and provide the same capabilities whether created in IB or created programmatically in your code.

… is there an equivalent for bringSubviewToFront: for OS X development? I need something to send an NSImageView "to front".

Be warned:

Cocoa does not enforce clipping among sibling views or guarantee correct invalidation and drawing behavior when sibling views overlap.

You may want to consider switching to CALayer for the things that need to overlap.

As a bonus, this may help you reuse code between Mac OS X and the iPhone OS.


Actually I think I found an answer (1 min after asking the question :D)... should have thought about things a bit more before asking.

I'm thinking addSubview:positioned:relativeTo: would be suitable for my needs. However I am still searching for a way that doesn't involve "addSubview".

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜