I have an UIImage above which I am supposed to add another UIImage programmatically, above which there will be an UILabel. I successfully added the Image but it overlaps the Label.
If 1. BG image 2.Image to be added programmatically 3. Label,
then the sequence I want is,
1
2
3
and what I get is
1
3
2
2 overlaps my Label. I have tried Send to Back, Bring to Front and bringSubviewToFront. It did not work.
What you should do is add the particular images in that sequence itself, i.e. in the ViewWillAppear or the ViewDidLoad method use the method
self.view addSubview:BGimage.Then add the next image on the previous one like
BGimage addSubview:image2.Similarly add the UILabel on the Image 2 like
Image2 addSubview:LabelThis will put your images and the label in the particular sequence you want 🙂