OS X version of bringSubviewToFront:?

前端 未结 6 625
我在风中等你
我在风中等你 2021-02-08 19:07

I need to replicate the function of bringSubviewToFront: on the iPhone, but I am programming on the Mac. How can this be done?

6条回答
  •  不思量自难忘°
    2021-02-08 19:33

    Haven't actually tried this out - and there may be better ways to do it - but this should work:

    NSView* superview = [view superview];  
    [view removeFromSuperview];  
    [superview addSubview:view];  
    

    This will move 'view' to the front of its siblings

提交回复
热议问题