I tested the solutions mentioned here
1.Using style="@style/Widget.AppCompat.Spinner ) and
Widget.AppCompat.Light.Spinner.DropDown.ActionBar
Both of these actions work only on Android 5.x and higher devices and do not work for Android devices running under 4.x and lower.
Therefore, I am posting my solution for those who want to have the βDrop-downβ effect for TextView for all devices.
An application needs to create a Drawable folder inside Drawable in the application, say dropdown_spinner.xml
<?xml version="1.0" encoding="utf-8"?> <bitmap xmlns:android="http://schemas.android.com/apk/res/android" android:src="@drawable/ic_icon_arrow" android:gravity="end" />
And then just use this as the background for the TextView, as shown below:
<TextView android:id="@+id/mySpinnerTextView" android:background="@drawable/dropdown_spinner" android:layout_width="match_parent" android:layout_height="wrap_content" />
AADProgramming
source share