title: How to modify display of spinner's listview
body: <p>In my Android App, I am trying to display a ListView on the click event of Spinner. I have tried to do this but getting some problem.</p>
  
  <ol>
  <li>The Down Arrow which I have used in my customized Spinner that arrow image is also coming in ListView of Spinner.</li>
  <li>On the Click Listener of Spinner I want a List to be shown like below Image,</li>
  </ol>
  
  <p><img src="https://i.stack.imgur.com/y98Rh.png" alt="enter image description here"></p>
  
  <p>ListView After Click on Spinner,</p>
  
  <p><img src="https://i.stack.imgur.com/WgJAI.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/ngn7o.png" alt="enter image description here"></p>
  
  <pre><code>String[] spinnervalues={"1","2","3","4","5","6"};
  
  public void onCreate(Bundle savedInstanceState)
  {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.addpassengers);
      Spinner myspinner=(Spinner)findViewById(R.id.spinner);
  
      myspinner.setAdapter(new MyAdapter(this, R.layout.custom_spinner, spinnervalues));
  
  public class MyAdapter extends ArrayAdapter&lt;String&gt;
  {
  
      public MyAdapter(Context context, int textViewResourceId, String[] objects) 
      {
          super(context, textViewResourceId, objects);
          // TODO Auto-generated constructor stub
      }
  
      @Override
      public View getDropDownView(int position, View cnvtView, ViewGroup prnt) 
      {
          return getCustomView(position, cnvtView, prnt);
      }
  
      @Override
      public View getView(int pos, View cnvtView, ViewGroup prnt) 
      {
          return getCustomView(pos, cnvtView, prnt);
      }
  
      public View getCustomView(int position, View convertView,ViewGroup parent) 
      {
          LayoutInflater inflater = getLayoutInflater();
          View myspinner = inflater.inflate(R.layout.custom_spinner, parent, false);
          TextView spinnertext = (TextView) myspinner
                  .findViewById(R.id.spinnertext);
          spinnertext.setText(spinnervalues[position]);
          return myspinner;
      }
  
  }
  </code></pre>
  
  <p>custom_spinner.xml file,</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:orientation="vertical"
  android:padding="3px" &gt;
  
  &lt;TextView
      android:id="@+id/spinnertext"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:layout_alignParentRight="true"
      android:layout_marginTop="1dip"
      android:padding="3px"
      android:text="JMD Grp"
      android:textColor="#0022ee"
      android:textSize="10dip"
      android:textStyle="bold" /&gt;
  
  &lt;!-- Rightend Arrow --&gt;
   &lt;ImageView
      android:id="@+id/downarrowiv" 
      android:layout_width="15dip"
      android:layout_height="15dip"
      android:src="@drawable/down_arrow"
      android:layout_alignParentRight="true"
      android:layout_centerVertical="true"/&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Custom_spinnerlist.xml file,</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:orientation="vertical"
  android:padding="3px" &gt;
  
  &lt;TextView
      android:id="@+id/spinnertext"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:layout_alignParentRight="true"
      android:layout_marginTop="1dip"
      android:padding="3px"
      android:text="JMD Grp"
      android:textColor="#0022ee"
      android:textSize="10dip"
      android:textStyle="bold" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>I have gone through many examples but didn't get my desired result.</p>
  
  <p>Is this due to version of android ?</p>
  
  <p>Please help.</p>
  
  <p>Thanks.</p>