0
votes

I have UIViewController which set top storyboard and having few subviews in storyboard. and I want to add a UIImageView programmatically and set it as a background view. so if I add a UIImageView, storyboard subviews are not visible.

how can I send this UIImageView behind all the storyboard subviews?

Thanks

2

2 Answers

2
votes

You need to go with the sendSubviewToBack:

 UIImageView *imgView = [[UIImageView alloc]initWithFrame:self.view.frame];
        imgView.image = [UIImage imageNamed:@"blank-background.jpg"];
        [self.view addSubview:imgView];
        [self.view sendSubviewToBack:imgView];
0
votes

use method of subview's "bringSubViewToFront". like

  [parentView bringSubViewToFront:subViewImg];