我正在尝试android ScaleDrawable
但它似乎不起作用...我在文档示例中创建了xml,我在drawable文件夹中有一个logo.png
<?xml version="1.0" encoding="utf-8"?>
<scale xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/logo"
android:scaleGravity="center_vertical|center_horizontal"
android:scaleHeight="80%"
android:scaleWidth="80%" />
Run Code Online (Sandbox Code Playgroud)
我将这个logo2.xml保存在drawable文件夹中然后我有一个带有ImageView的LinearLayout并将ImageView的src设置为"@ drawable/logo2"但徽标没有出现......我在这里做错了吗?你如何实际使用scale元素?
android ×1