android listview item style

<p>&lt;!-- res/values/styles.xml --&gt;</p><pre class="brush:xml;toolbar:false">&lt;stylename=&quot;ListView&quot;parent=&quot;@android:style/Widget.ListView&quot;&gt; &lt;itemname=&quot;android:background&quot;&gt;@color/light_grey&lt;/item&gt; &lt;itemname=&quot;android:cacheColorHint&quot;&gt;@android:color/transparent&lt;/item&gt; &lt;itemname=&quot;android:divider&quot;&gt;@android:color/transparent&lt;/item&gt; &lt;itemname=&quot;android:dividerHeight&quot;&gt;0dp&lt;/item&gt; &lt;itemname=&quot;android:listSelector&quot;&gt;@drawable/list_item_selector&lt;/item&gt; &lt;/style&gt;</pre><p>The @color/light_grey definition:</p><pre class="brush:xml;toolbar:false">&lt;!---res/values/colors.xml---&gt; &lt;?xmlversion=&quot;1.0&quot;encoding=&quot;utf-8&quot;?&gt; &lt;resources&gt; &lt;colorname=&quot;light_grey&quot;&gt;#cccccc&lt;/color&gt; &lt;/resources&gt;</pre><pre class="brush:xml;toolbar:false">&lt;?xmlversion=&quot;1.0&quot;encoding=&quot;utf-8&quot;?&gt; &lt;selectorxmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&gt; &lt;itemandroid:drawable=&quot;@drawable/item_selected&quot;android:state_pressed=&quot;true&quot;/&gt; &lt;itemandroid:drawable=&quot;@drawable/item_focused&quot;android:state_focused=&quot;true&quot;/&gt; &lt;itemandroid:drawable=&quot;@drawable/item_normal&quot;/&gt; &lt;/selector&gt;</pre>
RangeTime:0.006069s
RangeMem:205.08 KB
返回顶部 留言