title: spinner in android xml layout
body: <p>I'm trying to design a layout for an android app.
  this is the xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
      &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical" android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
  &lt;TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="New Text"
      android:id="@+id/nameFB"
      android:layout_gravity="end" /&gt;
  
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:orientation="horizontal"
          android:gravity="end"&gt;
  
          &lt;Spinner
  
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"/&gt;
  
          &lt;TextView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_gravity="end"
              android:text="@string/type_string" /&gt;
  
          &lt;EditText
              android:layout_width="50dp"
              android:layout_height="wrap_content"
              android:inputType="textPersonName"
              android:ems="10"
              android:id="@+id/yearTextName"
              android:background="@drawable/edit_text_style"/&gt;
  
          &lt;TextView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_gravity="end"
              android:text="@string/year_string" /&gt;
  
          &lt;EditText
              android:layout_width="75dp"
              android:layout_height="wrap_content"
              android:inputType="textPersonName"
              android:ems="10"
              android:id="@+id/creatorTextName"
              android:background="@drawable/edit_text_style"/&gt;
  
          &lt;TextView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_gravity="end"
              android:text="@string/creator_string" /&gt;
  
          &lt;EditText
              android:layout_width="75dp"
              android:layout_height="wrap_content"
              android:inputType="textPersonName"
              android:ems="10"
              android:id="@+id/nameTextBox"
              android:background="@drawable/edit_text_style"/&gt;
  
          &lt;TextView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_gravity="end"
              android:text="@string/name_string" /&gt;
  
  
      &lt;/LinearLayout&gt;
  
      &lt;ListView
          android:id="@+id/lv_search_results"
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
  
      &lt;/ListView&gt;
  &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>and it looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/c9Wa8.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/c9Wa8.jpg" alt="enter image description here"></a></p>
  
  <p>but when I add an id value for the spinner:</p>
  
  <pre><code>&lt;Spinner
              android:id="@+id/a"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"/&gt;
  </code></pre>
  
  <p>for some reason it ruins the layout:</p>
  
  <p><a href="https://i.stack.imgur.com/SUNt1.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SUNt1.jpg" alt="enter image description here"></a></p>
  
  <p>Does anyone know why does it happen? The only thing I'm changing is a value of an id, not something graphic.
  How can I fix it? Or how can I rearrange the xml so that the text boxes and the spinner will be visible with the text views (maybe in two rows)? I tried to put to linear layout one after the other and put in them the widgets, but every time it looks like the second picture.</p>