How do I make an NSView move to the front of all NSViews

前端 未结 7 1049
既然无缘
既然无缘 2020-12-28 12:47

I have a super view, which has 2 subviews. These subviews are overlapped.

Whenever i choose a view from a menu, corresponding view should become the front view and h

7条回答
  •  粉色の甜心
    2020-12-28 13:11

    You can achieve this by just adding the view again; it will not create another instance of it.

    [self addSubview:viewToBeMadeForemost];
    

    You can Log the number of subviews before and after this line of code is executed.

提交回复
热议问题