Last active
December 27, 2015 08:19
-
-
Save charlesmchen/7295668 to your computer and use it in GitHub Desktop.
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
UIImage *image = [UIImage imageNamed:@"Images/thun-stockhornkette-1904 1600.jpg"]; | |
UIImageView *background = [[UIImageView alloc] initWithImage:image]; | |
WeView *backgroundWrapper = [[WeView alloc] init]; | |
[[backgroundWrapper addSubviewWithFillLayoutWAspectRatio:background] | |
setVAlign:V_ALIGN_TOP]; | |
// The background will exceed the backgroundWrapper's bounds, so we need to clip. | |
backgroundWrapper.clipsToBounds = YES; | |
[demoModel.rootView addSubviewWithCustomLayout:[backgroundWrapper setStretches]]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment