I have a ListView with rounded corners made using the following shape as a background:
<?xml version="1.0" encoding="UTF-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android:color="#ffffff"/> <corners android:bottomRightRadius="13px" android:bottomLeftRadius="13px" android:topLeftRadius="13px" android:topRightRadius="13px"/> </shape>
The problem is the selector. It has a rectangle, so when you select the first or last element, the corners are no longer rounded. I found a very good solution in the last post at http://www.anddev.org/view-layout-resource-problems-f27/rounded-corners-on-listview-t8193-15.html . The problem is that I cannot get another class to inherit from ListView. How can I apply this method when the only thing I have is a link to an existing ListView? The reason I have to do this is because the layout is swollen from xml.
I am looking for something like:
ListView lv = (ListView)findViewById(...); lv.onSizeChanged = protected void onSizeChanged(int w, int h, int oldw, int oldh){ ... }
thank
android listview selector rounded-corners
Sebastian Nowak Jul 20 2018-11-12T00: 00Z
source share