I have drawn a UIView and then few CALayers as sublayers on its root layer.
Now when I resize the frame of the View. the Layers dont move at all according to the frame of the View.
How should I go about it ?
Do I have to remove the layers and redraw them once again on the new layer the frame draws to OR there is a simpler way ?
The sublayers should move with the view, but CALayers don’t have an autoresizingmask like UIViews do, so if you want them to stretch with the view frame, you’ll need to update the sublayer positions.
You can do this by implementing the
layoutSubviewsmethod of your view, and update the sublayers to wherever they should be in that method.