问题描述
当使用insertSublayer:abc.layer atindex:xy时,当前atindex:xy层会发生什么情况,文档尚不清楚。
我的实验结果好坏参半。
我的理解是索引0离用户最远(其他所有层都在该层之上)。
The documentation is not clear on what happens the the layer currently atindex:xy when using insertSublayer:abc.layer atindex:xy.My experimentation has had mixed results.My understanding is index 0 is furthest from the user (all other layers would be above that one).
如果我调用insertSublayer:abc.layer atindex: 0,并且def.layer已经在index:0上,那么def.layer是否被破坏或转移到index:1?
If I call insertSublayer:abc.layer atindex:0, and def.layer is already at index:0, does def.layer get destroyed, or shifted to index:1?
谢谢。
推荐答案
它不是破坏性的。 insertSublayer:atIndex:
只是将该子层插入sublayers数组中的该索引处,并且具有与在NSMutableArray中插入数组相关的所有正常行为
It is not destructive. insertSublayer:atIndex:
just inserts that sublayer at that index in the sublayers array, and has all the normal behavior associated with array insertion in an NSMutableArray
这篇关于CALayer insertSublayer:atindex:是否具有破坏性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!