Reputation: 1941
I am using this example to create splash screen for my android app. But the background image is stretching. Below is the code:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/colorPrimary" />
<item>
<bitmap android:src="@drawable/splash_portrait" />
</item>
</layer-list>
How to proportionately scale the bitmap?
Upvotes: 0
Views: 819
Reputation: 2229
The image you use should be a Vector Image.
Vector Images can resize at will and still retain clarity.
If you use normal images, no matter how you implement it, it will either stretch or shrink depending on the mobile screen.
Upvotes: 3