mirror of
https://github.com/scratchfoundation/scratchjr.git
synced 2024-11-28 18:15:37 -05:00
Merge pull request #326 from LLK/fix-initial-splash-resize
added constraints for splash screen image
This commit is contained in:
commit
027baa117c
1 changed files with 43 additions and 0 deletions
|
@ -66,6 +66,49 @@ NSDate *startDate;
|
||||||
[UIImage imageNamed:@"Default.png"],
|
[UIImage imageNamed:@"Default.png"],
|
||||||
nil];
|
nil];
|
||||||
[self.view addSubview:splashScreen];
|
[self.view addSubview:splashScreen];
|
||||||
|
|
||||||
|
// align splashScreen image to superview
|
||||||
|
splashScreen.translatesAutoresizingMaskIntoConstraints = NO;
|
||||||
|
// Trailing
|
||||||
|
NSLayoutConstraint *trailing = [NSLayoutConstraint
|
||||||
|
constraintWithItem:splashScreen
|
||||||
|
attribute:NSLayoutAttributeTrailing
|
||||||
|
relatedBy:NSLayoutRelationEqual
|
||||||
|
toItem:self.view
|
||||||
|
attribute:NSLayoutAttributeTrailing
|
||||||
|
multiplier:1.0f
|
||||||
|
constant:0.f];
|
||||||
|
// Leading
|
||||||
|
NSLayoutConstraint *leading = [NSLayoutConstraint
|
||||||
|
constraintWithItem:splashScreen
|
||||||
|
attribute:NSLayoutAttributeLeading
|
||||||
|
relatedBy:NSLayoutRelationEqual
|
||||||
|
toItem:self.view
|
||||||
|
attribute:NSLayoutAttributeLeading
|
||||||
|
multiplier:1.0f
|
||||||
|
constant:0.f];
|
||||||
|
// Top
|
||||||
|
NSLayoutConstraint *top = [NSLayoutConstraint
|
||||||
|
constraintWithItem:splashScreen
|
||||||
|
attribute:NSLayoutAttributeTop
|
||||||
|
relatedBy:NSLayoutRelationEqual
|
||||||
|
toItem:self.view
|
||||||
|
attribute:NSLayoutAttributeTop
|
||||||
|
multiplier:1.0f
|
||||||
|
constant:0.f];
|
||||||
|
// Bottom
|
||||||
|
NSLayoutConstraint *bottom = [NSLayoutConstraint
|
||||||
|
constraintWithItem:splashScreen
|
||||||
|
attribute:NSLayoutAttributeBottom
|
||||||
|
relatedBy:NSLayoutRelationEqual
|
||||||
|
toItem:self.view
|
||||||
|
attribute:NSLayoutAttributeBottom
|
||||||
|
multiplier:1.0f
|
||||||
|
constant:0.f];
|
||||||
|
[self.view addConstraint:leading];
|
||||||
|
[self.view addConstraint:trailing];
|
||||||
|
[self.view addConstraint:top];
|
||||||
|
[self.view addConstraint:bottom];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)didReceiveMemoryWarning
|
- (void)didReceiveMemoryWarning
|
||||||
|
|
Loading…
Reference in a new issue