私はこれらの 2 つの 9 パッチを持っています:
ここに私のXMLがあります:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/switch_bg"
android:layout_width="45dp"
android:layout_height="32dp"
android:background="@drawable/switch_bg_off"
android:padding="0dp" >
<ImageView
android:id="@+id/switch_bg2"
android:layout_width="45dp"
android:layout_height="32dp"
android:layout_centerInParent="true"
android:src="@drawable/switch_bg_off" />
<RelativeLayout
android:id="@+id/switch_handle"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:background="@drawable/switch_handle"
android:padding="0dp" >
<ImageView
android:id="@+id/switch_v"
android:layout_width="15dp"
android:layout_height="15dp"
android:layout_centerInParent="true"
android:src="@drawable/switch_v" />
</RelativeLayout>
</RelativeLayout>
しかし、グラフィックエディタと私のアプリ自体で
白いボックスは半分にカットされ、不適切に表示されます:
どうすればこれを修正できますか?