title: android how to wrap spinner drop down text (android 4)
body: <p>I have a <code>Spinner</code> where the text both inside the spinner and the choices when the spinner is expanded (drop down view) can be quite long depending on the locale. i set a custom view for both the spinner view and the drop down view that should allow the text lines to wrap,</p>
  <pre><code>&lt;CheckedTextView xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      style=&quot;?android:attr/spinnerDropDownItemStyle&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;wrap_content&quot;
      android:ellipsize=&quot;none&quot;
      android:minHeight=&quot;?android:attr/listPreferredItemHeight&quot;
      android:singleLine=&quot;false&quot; /&gt;
  </code></pre>
  <p>and in the code,</p>
  <pre><code>    spinnerPermission = (Spinner) layout.findViewById(R.id.permission_spinner);
      ArrayAdapter&lt;CharSequence&gt; permissionAdapter = ArrayAdapter.createFromResource(getActivity(), R.array.add_share_dialog_permissions,
          R.layout.multiline_spinner_dropdown_item);
      permissionAdapter.setDropDownViewResource(R.layout.multiline_spinner_dropdown_item);
      spinnerPermission.setAdapter(permissionAdapter);
  </code></pre>
  <p>this works fine in android 2, but in android 4, the text in the drop down view still won't wrap,</p>
  <p><img src="https://i.stack.imgur.com/qV43Y.png" alt="enter image description here" /></p>
  <p>although it's not clear from the image, the text in the spinner view does wrap correctly. I can't tell for sure, but it seems like the container around the drop down views is not constrained by the screen and expands off the screen to the right. That would prevent the text from wrapping, because as far as the <code>TextView</code> is concerned, there's plenty of space.</p>
  <p>Here is the spinner's popup view in hierarchy viewer,</p>
  <p><img src="https://i.stack.imgur.com/E1IVq.png" alt="enter image description here" /></p>
  <p>Any ideas?</p>