开发者

How to tell whether on sub-view's is above another sub-view?

开发者 https://www.devze.com 2022-12-29 05:50 出处:网络
Assume there are 3 sub-views (A, B, C) in a view. After a few rounds of random bringSubviewToFront and s开发者_如何学运维endSubviewToBack on A, B, or C , how can I tell whether one sub-view (e.g. A) i

Assume there are 3 sub-views (A, B, C) in a view. After a few rounds of random bringSubviewToFront and s开发者_如何学运维endSubviewToBack on A, B, or C , how can I tell whether one sub-view (e.g. A) is on top of another sub-view (e.g. C)?

Whether they overlap each other is not required information.

Thanks!


The order of subviews in a view is the same as the order in the subviews array. Which ever subview has a higher index in the subviews array is on top.

0

精彩评论

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