【问题标题】:How to increase the width and height of an picture?如何增加图片的宽度和高度?
【发布时间】:2019-03-22 09:57:56
【问题描述】:

我有一个 no 布局的活动。我直接在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,则不会发生任何事情。

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

【问题讨论】:

    标签: android android-activity android-drawable android-theme android-background


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-03-05
      • 1970-01-01
      • 2013-11-18
      • 2015-09-30
      • 1970-01-01
      • 1970-01-01
      • 2017-03-19
      相关资源
      最近更新 更多