title: How can i make a spinner prompt multiline?
body: <p>I have a spinner that allows me to not show the first item in the list, but i can set my custom prompt. However whenever the prompt text spans more than one line it is cut off at the view bounds. How can i make the spinner prompt expand to accommodate more text?</p>
  
  <p>I have tried modifying the view passed into the adapter to have multiple lines and also to ellipsize at the end, but nothing works.</p>
  
  <p>Images for clarity:
  With one line of text,
  <a href="https://i.stack.imgur.com/IhGTc.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IhGTc.jpg" alt="enter image description here"></a></p>
  
  <p>With several lines,
  <a href="https://i.stack.imgur.com/qO0rL.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qO0rL.jpg" alt="enter image description here"></a></p>
  
  <p>This is my code:</p>
  
  <pre><code>  languagesSpinner.setAdapter(new ArrayAdapter&lt;&gt;(EditProfileNationalityActivity.this, R.layout.no_default_spinner_item, new String[] {""}));
  
  if(data.length&gt;0) {
    String countries = spokenLanguages.toString().substring(0, spokenLanguages.toString().length() - 2);
          languagesSpinner.setPrompt(countries);
  } else {
  
          Log.e("setting prompt to default");
          languagesSpinner.setPrompt("Please select languages");
  }
  </code></pre>
  
  <p>and this is the xml file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;TextView xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:gravity="center_vertical"
  android:layout_gravity="center_vertical"
  android:textColor="@android:color/black"
  android:textSize="18sp"
  android:ellipsize="end"
  android:lines="2"
  android:paddingTop="5dp"
  android:paddingBottom="5dp"
  android:paddingLeft="1dp"
  android:paddingRight="1dp"
  android:background="?android:attr/activatedBackgroundIndicator" /&gt;
  </code></pre>
  
  <p>Per request, xml definition of spinner is as follows:</p>
  
  <pre><code>  &lt;com.package.views.NoDefaultSpinner
              android:id="@+id/registration_stage_4_country_languages"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginTop="20dp"
              android:clickable="false" /&gt;
  </code></pre>
  
  <p>NoDefaultSpinner.java can be found here: <a href="https://github.com/geftimov/android-components/blob/master/components/src/main/java/com/eftimoff/components/views/spinners/nodefault/NoDefaultSpinner.java" rel="nofollow noreferrer">https://github.com/geftimov/android-components/blob/master/components/src/main/java/com/eftimoff/components/views/spinners/nodefault/NoDefaultSpinner.java</a></p>
  
  <p>I have modified it to have a custom getView() method in the SpinnerProxy like this: </p>
  
  <pre><code> if (position &lt; 0) {
              if (layoutResource == -1) {
                  layoutResource = R.layout.no_default_spinner_item;
              }
              final TextView v =
                      (TextView) ((LayoutInflater) getContext().getSystemService(
                              Context.LAYOUT_INFLATER_SERVICE)).inflate(
                              layoutResource, parent, false);
              v.setText(getPrompt());
              v.setPadding(0, 5, 0, 5);
  
              return v;
          }
          return obj.getView(position, convertView, parent);
      }
  </code></pre>