如何将superview带到前面? [英] how does one bring superview to front?

查看:31
本文介绍了如何将superview带到前面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通常开发人员会尝试将子视图放在前面.相反,如何将超级视图带到前面?

Normally developers try to bring subview to front. On contrary, how does one bring superview to front?

我正在寻找 bringSubviewToFront(_:) 的反面.它应该看起来像 bringSuperviewToFront(_:)

I'm looking for a reverse of bringSubviewToFront(_:). It should look like bringSuperviewToFront(_:)

推荐答案

我正在寻找一个相反的 combineSubviewToFront(:).它应该看起来像 combineSuperviewToFront(:)

那不存在.不要为您的按钮提供子视图,而是同时创建某个容器的子视图和按钮子视图.然后您可以调整它们的相对 z 位置以适合您的目的.

That doesn't exist. Instead of giving your button a subview, make both the subview and the button subviews of some container. Then you can adjust their relative z positions to suit your purpose.

这篇关于如何将superview带到前面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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