Skip to content

Commit a47f8fd

Browse files
authored
Update README.md
Change the default launch_screen.xml to keep the ratio on Android
1 parent 17b0c09 commit a47f8fd

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
@@ -167,11 +167,11 @@ Create a file called `launch_screen.xml` in `app/src/main/res/layout` (create th
167167
168168
```xml
169169
<?xml version="1.0" encoding="utf-8"?>
170-
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
170+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
171171
android:orientation="vertical" android:layout_width="match_parent"
172-
android:layout_height="match_parent"
173-
android:background="@drawable/launch_screen">
174-
</LinearLayout>
172+
android:layout_height="match_parent">
173+
<ImageView android:layout_width="match_parent" android:layout_height="match_parent" android:src="@drawable/launch_screen" android:scaleType="centerCrop" />
174+
</RelativeLayout>
175175
```
176176

177177
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)