我有一个带有以下代码的可绘制repeatable_stencil.xml
:
<?xml version="1.0" encoding="utf-8"?>
<bitmap
xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/stencil"
android:tileMode="repeat"/>
然后在这样的ImageView中使用它:
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/repeatable_stencil"
/>
设置我的imageview的方式应该用repeatable_stencil
填充其父视图。它确实可以完成工作,但是不正确。
stencil
图像的像素约为2500 x 4000
。但是,当像我上面那样使用它时,位图会自动缩放,stencil
图像会超级缩放。
我想将其缩小到自定义尺寸。