title: android spinner dropdown checkbox
body: <p>I have <code>Spinner</code> like this :</p>
  
  <pre><code>&lt;Spinner
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:id="@+id/spinner1"
                  android:background="@drawable/spinner_bg"
                  android:popupBackground="@drawable/spinner_bg"/&gt;
  </code></pre>
  
  <p>this is <strong>spinner_bg.xml</strong> :</p>
  
  <p></p>
  
  <pre><code>&lt;item&gt;
      &lt;layer-list&gt;
          &lt;item&gt;
              &lt;shape&gt;
                  &lt;gradient
                      android:startColor="#ffffff"
                      android:centerColor="#111111"
                      android:endColor="#000000"
                      android:angle="-90" /&gt;
  
                  &lt;stroke
                      android:width="2dp"
                      android:color="#ffffff" /&gt;
  
                  &lt;corners
                      android:radius="2dp" /&gt;
  
                  &lt;padding
                      android:left="10dp"
                      android:right="10dp"/&gt;
              &lt;/shape&gt;
          &lt;/item&gt;
          &lt;item &gt;
              &lt;bitmap
                  android:gravity="right"
                  android:src="@android:drawable/arrow_down_float" /&gt;
          &lt;/item&gt;
      &lt;/layer-list&gt;
  &lt;/item&gt;
  </code></pre>
  
  <p></p>
  
  <p>this is my code to Custom spinner :</p>
  
  <pre><code>ArrayAdapter&lt;ClassId&gt; adapter = new ArrayAdapter&lt;ClassId&gt;(getActivity(),
                          R.layout.list_id, idList);
                  adapter.setDropDownViewResource(R.layout.list_id_select);
  </code></pre>
  
  <p>this is layout of <strong>list_id.xml</strong> :</p>
  
  <pre><code>&lt;TextView xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:textAllCaps="true"
  android:singleLine="true"
  android:ellipsize="end"
  android:textColor="#ff0004"
  android:textSize="14sp"
  android:paddingTop="10dp"
  android:paddingBottom="10dp"/&gt;
  </code></pre>
  
  <p>this is layout of <strong>list_id_select.xml</strong> :</p>
  
  <pre><code>&lt;CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:textAllCaps="true"
  android:singleLine="true"
  android:ellipsize="end"
  android:textColor="#0004ff"
  android:textSize="14sp"
  android:checked="true"
  android:checkMark="@drawable/custom_checkbox"
  android:paddingTop="10dp"
  android:paddingBottom="10dp"/&gt;
  </code></pre>
  
  <p>and this is <strong>custom_checkbox.xml</strong> :</p>
  
  <pre><code>&lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  &lt;item android:state_checked="true"
      android:drawable="@android:drawable/checkbox_on_background" /&gt; 
  
  &lt;item android:state_pressed="true"
      android:drawable="@android:drawable/checkbox_on_background" /&gt; 
  
  &lt;item android:drawable="@android:drawable/checkbox_off_background" /&gt; 
  </code></pre>
  
  <p></p>
  
  <p>this is my result when dropdown of spinner show :
  _________________________________________________<br>
  __________________________checkbox_______________<br>
  ____text_________________________________________<br></p>
  
  <p>that mean text and checkbox not in line (checkbox higher than text).<br>
  how to fix it?</p>