bringSubviewToFront的OS X版本:? [英] OS X version of bringSubviewToFront:?

查看:181
本文介绍了bringSubviewToFront的OS X版本:?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要复制bringSubviewToFront:的功能在iPhone上,但我在Mac上编程。

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

推荐答案

实际上没有尝试过 - 可能有更好的方法 - 但是,这应该工作:

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];  

这会将view移动到其兄弟姐妹的前面

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

这篇关于bringSubviewToFront的OS X版本:?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆