I want to make the corners of the list round, what can I do?
android-listview android-layout android
You can define and apply the xml of drawable.
res/drawable/customshape.xml
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:startColor="#SomeGradientBeginColor"
android:endColor="#SomeGradientEndColor"
android:angle="270"/>
<corners
android:bottomRightRadius="7dp"
android:bottomLeftRadius="7dp"
android:topLeftRadius="7dp"
android:topRightRadius="7dp"/>
</shape>
Please define it like this and go to the list view
In code, listView.setBackgroundResource(R.drawable.customshape);
Like this.
If you want to give properties to xml,
android:background="@drawable/customshape"
You can do it in this way.
© 2024 OneMinuteCode. All rights reserved.