如何增加图片的宽度和高度?

How to increase the width and height of an picture?

我有一个 activity 没有 布局。我直接在 AndroidManifest:

中设置为主题
android:theme="@style/MyTheme">

我的主题只包含一个背景:

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

这是只包含一项的背景文件:

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

ic_launcher 是具有不同大小(hdpi、mdpi 等)的图标。问题是,如果我将 widthheight 设置为 200dp,项目会变大,但图像仍然很小。如果我将 widthheight 设置为 bitmap 什么也不会发生。

如何增加实际图片的宽度和高度?

在这种情况下,您应该尝试使用 Vector Image 以获得适合任何高度或比例的质量。