我已经创建了以下 Nine-Patch PNG 图像,但是当我将其作为按钮的背景添加时,我得到了以下结果:如您所见,图片没有填充整个按钮背景。这是 XML 布局文件:
有人能告诉我为什么吗?
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<Button
android:id="@+id/btn"
android:layout_width="match_parent"
android:layout_height="100dp"
android:background="@drawable/ninepatchimage"
android:text="Click ME" />
</LinearLayout>
有人能告诉我为什么吗?