I am able to setup a listview using custom adapter which shows correct output..Now i want to change the background of each listview items to a gradient.. how it could be done?
My files…
activity_main.xml….Main xml file
MainActivity.java….Main activity
Item.java…. item selector method
ItemAdaptor…. custom adapter
list_item.xml….. item (textView) styling
I have created my gradient code which is like..
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:startColor="#FFFAFAFA"
android:centerColor="#FFFFFFFF"
android:endColor="#FFFAFAFA"
android:angle="90"/>
</shape>
also how could I change the separator color,and the background color of the whole listview..
Have you mentioned
android:background="@drawable/customshape"in your rowLayout.xml so that it knows which shape is to be used? Also useandroid:divider="#FFCC00"in your listview tag to change the seperator color. Add<solid android:color="#F0F0F0" />to your shape so as to change the background color.