How to add a view behind other view in iOS
Besides addSubview
, there are other methods you can rely on to add your view:
– insertSubview:aboveSubview:
– insertSubview:belowSubview:
– insertSubview:atIndex:
You can control the index (actually z-index, or layer order) of the view using these methods.
try sendSubviewToBack
[self.view sendSubviewToBack:leftPanelView];