Search code examples
androidandroid-activityandroid-drawableandroid-themeandroid-background

How to increase the width and height of an picture?


I have an activity with no layout. I set it like a theme directly in AndroidManifest:

android:theme="@style/MyTheme">

My theme contains only a background:

<style name="MyTheme"
    <item name="android:windowBackground">@drawable/background</item>
</style>

And this is the background file which contains only one item:

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:width="200dp"
        android:height="200dp">
        <bitmap
            android:gravity="center"
            android:src="@mipmap/ic_launcher"/>
    </item>
</layer-list>

The ic_launcher is the icon that has different sizes (hdpi, mdpi etc). The problem is that if I set the width and height to 200dp, the item gets bigger but the image remains small. If I set the width and height to the bitmap nothing happens.

How to increase the width and height of the actual picture?


Solution

  • You this scenario you should try using a Vector Image for a proper quality for any height or ratio.