Android - Listview API's
I am creating listview dyanamicaly in the code..Not through XML....!!
Two th开发者_JS百科ings i couldnt apply to the listview though code which i could apply through XML attributes.
1) android:divider="@android:color/transparent"
2) android:scrollbars="none"
What are the equivalent API's for these.
There are usually a pair of get and set methods with a similar name to the xml attribute. I believe the ones you want are View#setVerticalScrollBarEnabled()
and ListView#setDivider()
:
http://developer.android.com/reference/android/view/View.html#setVerticalScrollBarEnabled%28boolean%29
http://developer.android.com/reference/android/widget/ListView.html#setDivider%28android.graphics.drawable.Drawable%29
You can use this for de divider.
setDivider(getResources().getDrawable(android.R.color.transparent));
About the scrollbars I can't found anything. But if you adjust the content to the list size the scroollbar should not appear.
精彩评论