开发者

how to compare the hierarchical order of two subviews?

I want to find a way how I can compare the actual hierarchical order of two subviews.

As i didn't find a method who turns out to give me this kind of result,开发者_开发百科 I want to ask you. Im sure there must be a way to do this.

Is it possible, that the [view subviews] array is ordered with the same hierarchy?

Thanks, Makrus


Although I have not find any reference about that in docs I'm pretty sure that the order of elements in subviews array corresponds to their z-order. You can try to change order of subviews in IB and log subviews to console - you will see that output supports that.

One more hint that it is really so are insertSubview:atIndex: and exchangeSubviewAtIndex:withSubviewAtIndex: methods which change subview's z-order and those changes are reflected in subviews array order...

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜