我刚开始学习Android编程。最近,我开始了一个项目,并希望为Android应用程序制作一个闪屏屏幕。我阅读了并成功地实现了这个闪屏屏幕,方法是在遵循此教程。然而,我发现我的应用程序标志拉伸出了屏幕,像这样:
以下是我的background_splash.xml
:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:drawable="@drawable/splash_background" />
<item>
<bitmap
android:gravity="center"
android:src="@drawable/tap" />
</item>
</layer-list>
我尝试过
android:width="75sp"
android:height="75sp"
我试过在<bitmap>
中调整大小,但没有成功。所以,我想知道是否有一种方法可以调整图像的大小(最好不用Java代码),除了使用 ImageView
。 谢谢!
in <bitmap>
but it does not work. Thus, I would like to know if there is a way to resize the image (without Java code, preferably) except for using an ImageView
. Any help would be appreciated!