1
我正在使用9patch圖像作爲我的ListView
項目xml文件。強制9patch圖像以適合寬度,使用填充
但是,圖像背景似乎不符合佈局寬度。
Item.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingBottom="10dp"
android:paddingTop="4dip"
android:orientation="horizontal"
android:background="@drawable/lvbg" >
<TextView
android:id="@+id/tvDate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:text="Date"
android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView
android:id="@+id/name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/tvDate"
android:gravity="center"
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#31B6E7" />
</RelativeLayout>
List.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ListView
android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FFFFFF"
android:cacheColorHint="#00000000"
android:divider="#FFFFFF"
android:listSelector="@drawable/list_selector"
android:paddingBottom="10dp"
android:saveEnabled="true"
android:smoothScrollbar="true" />
</LinearLayout>
什麼我acheiving
我需要什麼:
這是我9patch圖像
是否有可能迫使TextView的內部,同時,該9patch圖像能夠填補一些DP填充屏幕寬度雙方。
在此先感謝。