Skip to content

Commit 47eacbe

Browse files
iOS: set contentMode to ScaleAspectFit
1 parent f87cbb8 commit 47eacbe

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

ios/RCTSplashScreen/RCTSplashScreen/RCTSplashScreen.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ + (void)open:(RCTRootView *)v withImageNamed:(NSString *)imageName {
2323
UIImageView *view = [[UIImageView alloc]initWithFrame:[UIScreen mainScreen].bounds];
2424

2525
view.image = [UIImage imageNamed:imageName];
26-
26+
view.contentMode = UIViewContentModeScaleAspectFit;
27+
2728
[[NSNotificationCenter defaultCenter] removeObserver:rootView name:RCTContentDidAppearNotification object:rootView];
2829

2930
[rootView setLoadingView:view];

ios/SplashScreenResource/LaunchScreen.xib

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
<objects>
88
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
99
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
10-
<view contentMode="scaleToFill" id="iN0-l3-epB">
10+
<view contentMode="scaleAspectFill" id="iN0-l3-epB">
1111
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
1212
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
1313
<subviews>
14-
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="splash.png" translatesAutoresizingMaskIntoConstraints="NO" id="ZkI-RL-69Z">
14+
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="splash.png" translatesAutoresizingMaskIntoConstraints="NO" id="ZkI-RL-69Z">
1515
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
1616
</imageView>
1717
</subviews>

0 commit comments

Comments
 (0)