1

In my string array i have a long text that I want to display in my Spinner(this Spinner is in a dialog)..i tried the below code

 spinner1 = (Spinner) dialog.findViewById(R.id.quesspinner);
 ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(activity,
                    android.R.layout.simple_spinner_item, R.array.fbquestion);
            arrayAdapter .setDropDownViewResource(R.layout.textview);
            spinner1.setAdapter(arrayAdapter); 

and my text view as below

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/text1"
    style="?android:attr/spinnerDropDownItemStyle"
    android:singleLine="true"
    android:layout_width="fill_parent"
    android:layout_height="?android:attr/listPreferredItemHeight"
    android:ellipsize="marquee" />

this is working for most people, but not for me not sure where I am going wrong; did according to this SO questions How to wrap lengthy text in a spinner

Wrapping text in spinner android

any help is appreciated.

Community
  • 1
  • 1
teekib
  • 2,821
  • 10
  • 39
  • 75

0 Answers0