title: How to right-align Android spinner
body: <p>I'm trying to right-align the text of an Android spinner. I have been through Stack Overflow and tried the recommended solution but it's not working for me so, I'm a little confused as to what I have done wrong. My feeling is that my layout is not being correctly picked up due to an error I have made.</p>
  
  <p>My activity.xml file</p>
  
  <pre><code>&lt;Spinner
  android:id="@+id/spinnerStoreType"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:layout_weight="1"/&gt;
  </code></pre>
  
  <p>Under res\layout I have created a file called simple_spinner_item.xml</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:textSize="40sp"
      android:textColor="#FFFFFF"
      android:padding="10dip"
      android:gravity="right"
      /&gt;
  </code></pre>
  
  <p>Finally, in my activity I am using this as follows:</p>
  
  <pre><code>spinnerStoreType = (Spinner) findViewById(R.id.spinnerStoreType);
  ArrayAdapter&lt;CharSequence&gt; adapter =    
  ArrayAdapter.createFromResource(this,
  R.array.transaction_store_array, android.R.layout.simple_spinner_item);
  
  adapter.setDropDownViewResource(android.R.layout.simple_spinner_item);
  spinnerStoreType.setAdapter(adapter);
  </code></pre>
  
  <p>So, I believe that the simple_spinner_item being used is the default one, Android's one. I'm unclear how to get it to use my custom one. I thought that would happen automatically if it has the same name?</p>
  
  <p>Any help as always is very much appreciated.</p>