I want my background to be an image, so in IB I set a UIImageView
with the constraints to be the same size as the its UIView
. However, when I select "back
" on the UINavigationBar
, when the NavControl
pops to the previous VC
, this is what's there, briefly, before it disappears:
That is, the UIImageView
is so big that it is almost double the width of the UIView, so as it slides off-screen to the right, the UIImageView
's image drags on before finally disappearing.
I have also tried to do this programmatically, but even if I set the UIImageView
's frame to be CGRectMake(0, 0, 100, 100)
, it still goes off to the left side of the UIView
, as if the UIView
's origin weren't at the top left corner, but slightly off the screen. Is this possible? How do I make it so the image fits the screen and doesn't go off?
If it's at all relevant, the jpg
I'm using is in Images.xcassets
and, although I can select it in IB and it appears, the UIImageView
's image is white/blank, so in my viewDidLoad
method I need to specify self.imageView.image = [UIImage imageNamed:@"hockeyIce.jpg"]
.