I’m using CCUIViewWrapper to wrap some UIView functionality but CCUIViewWrappers are always on top of any other CCLayers.My other layers were coveded by CCUIViewWrappers. I tried to change CCUIViewWrappers’s z position but i can’t see any changes. Can anyone help?
UIViews are z-ordered relative to UIViews (based on their superview/subview relationships), not to your cocos2d content. In your case, that means relative to the GLView that cocos2d draws in, meaning above it.That’s why the cocos2d content is always behind your UIView elements.
Aside from stacking views above and below the GLView (not using the wrapper) and making the GLView transparent, you can’t do anything. You certainly can’t put UIKit elements at any cocos2d z-order, since that z-order only applies to cocos2d elements, not the subviews you’re adding. So, you can add UIViews below all cocos2d content or above all cocos2d content or both, but not within it. To do any of that other than “above all cocos2d content,” you need to work with UIViews directly, not CCUIViewWrappers.