我在框架佈局創造了一個ListView項:的ListView不是全寬
home_activity.xml:
<FrameLayout 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"
tools:context=".Home">
<ListView
android:id="@+id/home_item_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical">
</ListView>
</FrameLayout>
home_list_item.xml:
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/home_item_activity_selector_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:minHeight="?android:attr/listPreferredItemHeight"
android:paddingLeft="15dp"
/>
我proble是,ListView項不是屏幕寬度的100%,只有標籤的寬度
我必須改變什麼?
'的android:layout_width = 「WRAP_CONTENT」'? – njzk2
@ njzk2不,我想盡一切可能 –