android - What is a divider color attribute in ListView? -
i want create divider, divider in listview , depend on current theme.
<view android:id="@+id/first_line" android:layout_width="match_parent" android:layout_below="@+id/description" android:layout_height="1dp" android:layout_marginbottom="7dp" android:layout_margintop="7dp" android:background="?attr/colorprimarydark"/> which attribute should specify in line android:background="attr/colorprimarydark" handle this?
check android styles file. divider in listview it's drawable. example:
<style name="widget.listview" parent="widget.abslistview"> <item name="listselector">@drawable/list_selector_background</item> <item name="cachecolorhint">?attr/colorbackgroundcachehint</item> <item name="divider">@drawable/divider_horizontal_dark_opaque</item> </style> so can create view:
<view android:id="@+id/my_divider" android:layout_width="match_parent" android:layout_height="1dp" android:background="@android:drawable/divider_horizontal_dark"/> see drawable same theme app(for example).
Comments
Post a Comment