这是我工作正常的代码,我只想在listview
. 所以,我的问题是如何在listview
. 注意:我只想添加边框,我可以在哪里放置边框?任何帮助将不胜感激。谢谢
<ListView android:id="@+id/listCategory"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:fadeScrollbars="true"
android:fastScrollEnabled="true"
android:listSelector="@drawable/listview_selector"
android:dividerHeight="1dp"
android:layout_below="@+id/gridlayout"
android:visibility="gone"/>
listview_selector.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_focused="true" android:drawable="@drawable/listview_selector_focussed" />
<item android:state_pressed="true" android:drawable="@drawable/listview_selector_pressed" />
</selector>
listview_selector_focussed.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<gradient android:startColor="#0a89f1" android:endColor="#56768d" android:angle="90" />
</shape>
listview_selector_pressed.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<gradient android:startColor="#0a89f1" android:endColor="#56768d" android:angle="90" />
</shape>