Maximize visible rows in a listview

浪尽此生 提交于 2019-12-04 19:09:05

Add android:cacheColorHint="#00000000" in your listview. Here's the second segment of your code rewritten with cacheColorHint:

<RelativeLayout
    android:layout_width="wrap_content"
    android:layout_height="150dp"
    android:layout_marginTop="15px"
    android:background="@drawable/border"
    android:layout_centerHorizontal="true"
    android:orientation="vertical">
    <ListView
        android:id="@+id/listview_data"
        android:layout_width="300px"
        android:layout_height="wrap_content"
        android:columnWidth="30px"
        android:gravity="center"
        android:numColumns="10"
        android:cacheColorHint="#00000000" >
    </ListView>
</RelativeLayout>

It removes the shadow/turning the screen black problem of your ListView.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!