Reputation: 3273
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
Upvotes: 0
Views: 389
Reputation: 15335
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];
Upvotes: 2
Reputation: 26
use method of subview's "bringSubViewToFront
".
like
[parentView bringSubViewToFront:subViewImg];
Upvotes: 0