Skip to content

Commit 52689d0

Browse files
authored
Merge pull request #297 from ishigamii/master
Update README.md to modify the default launch_screen.xml for ratio keeping on Android
2 parents 490c296 + a47f8fd commit 52689d0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,11 @@ Create a file called `launch_screen.xml` in `app/src/main/res/layout` (create th
169169
170170
```xml
171171
<?xml version="1.0" encoding="utf-8"?>
172-
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
172+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
173173
android:orientation="vertical" android:layout_width="match_parent"
174-
android:layout_height="match_parent"
175-
android:background="@drawable/launch_screen">
176-
</LinearLayout>
174+
android:layout_height="match_parent">
175+
<ImageView android:layout_width="match_parent" android:layout_height="match_parent" android:src="@drawable/launch_screen" android:scaleType="centerCrop" />
176+
</RelativeLayout>
177177
```
178178

179179
Customize your launch screen by creating a `launch_screen.png`-file and placing it in an appropriate `drawable`-folder. Android automatically scales drawable, so you do not necessarily need to provide images for all phone densities.

0 commit comments

Comments
 (0)