Add the following code to your list item
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
See the screenshot
If you want to remove border in listview , add the code in listview xmlandroid:divider="@null"
android:dividerHeight="0dp"ORandroid:divider="@android:color/transparent" OR
<ListView android:id="@+id/my_list_view"
android:layout_width="match_parent"
android:layout_height="match_parent"android:divider="@null"/>
Comments
Post a Comment