you use the built-in layout which
android.R.layout.simple_list_item_1
This layout cannot be changed. However, you can provide your own line layout.
your line should look like this:
<?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/text1" android:layout_height="?android:attr/listPreferredItemHeight" android:layout_width="fill_parent" android:textSize="20sp" android:paddingLeft="6dip" android:paddingRight="6dip" android:gravity="center" />
remember that the identifier should only be android:id="@android:id/text1"
and now you can pass this to the ArrayAdapter constructor:
ArrayAdapter<String>(this,R.layout.my_custom_layout,conversionsadd);
Adil Soomro Jan 19 2018-12-12T00: 00Z
source share