Created
June 8, 2015 06:08
-
-
Save lcaballero/ff2b715aa2463ee27933 to your computer and use it in GitHub Desktop.
Snippet of code that put's an image in the background of a UIImageView and scales it appropriately to the main window dimentions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UIScreen* mainScreen = [UIScreen mainScreen]; | |
CGRect frame = mainScreen.bounds; | |
MyUIView* view = [[MyUIView alloc] initWithFrame:frame]; | |
UIImage* background = [UIImage imageNamed:@"[email protected]"]; | |
UIImageView* bgView = [[UIImageView alloc] initWithImage:background]; | |
bgView.frame = frame; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment