android給listview設(shè)置分割線Divider樣式
設(shè)置分割線的例子如下:
<ListView android:id="@+id/HomeListView" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:divider="#123"
android:layout_margin="10dip"></ListView>
但運(yùn)行后,發(fā)現(xiàn)樣式?jīng)]起作用。
解決辦法:
給listview設(shè)置android:dividerHeight為非0即可。
如:
android:layout_height="fill_parent" android:divider="#123"
android:layout_margin="10dip"></ListView>
但運(yùn)行后,發(fā)現(xiàn)樣式?jīng)]起作用。
解決辦法:
給listview設(shè)置android:dividerHeight為非0即可。
如:
<ListView android:id="@+id/HomeListView" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:divider="#000"
android:dividerHeight="1px"
android:layout_margin="10dip"></ListView>
android:layout_height="fill_parent" android:divider="#000"
android:dividerHeight="1px"
android:layout_margin="10dip"></ListView>
posted on 2011-10-29 23:47 小一敗涂地 閱讀(63141) 評(píng)論(2) 編輯 收藏 所屬分類: android+移動(dòng)開(kāi)發(fā)