title: Multiline textview getting cut off in height
body: <p>I have a <code>TextView</code> next to an <code>ImageButton</code> in a horizontal <code>LinearLayout</code> which is then wrapped in a vertical <code>LinearLayout</code>. To get the button to show up I had to set a <code>layout_weight</code> on the text view and button with the button being the stronger of the two. However this seems to make the button decide the height of both of them, even if the text needs to be higher. Is there any way to get around this?</p>
  
  <pre><code>&lt;LinearLayout
      android:orientation="vertical"
      android:layout_height="match_parent"
      android:layout_margin="5dp"
      android:layout_width="wrap_content"&gt;
  
  
      &lt;LinearLayout
          android:orientation="horizontal"
          android:layout_height="wrap_content"
          android:layout_width="match_parent"&gt;
  
          &lt;TextView
              android:layout_width="0dp"
              android:layout_height="wrap_content"
              android:textColor="@color/text_color"
              android:textSize="@dimen/medium_font"
              android:layout_gravity="center"
              android:text="A long text that wraps correctly but then gets cut off"
              android:layout_weight="1" /&gt;
  
          &lt;ImageButton
              android:contentDescription="@string/share_button"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:id="@+id/share_button"
              android:padding="5dp"
              android:layout_weight="0"
              android:layout_gravity="center"
              android:scaleType="center"
              android:background="@android:color/transparent"
              android:src="@mipmap/ic_menu_share_holo_dark"/&gt;
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:background="@drawable/button_background"
          android:id="@+id/distances_parent"&gt;
          &lt;Spinner
              android:layout_margin="5dp"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:entries="@array/distance_labels"
              android:id="@+id/distances" /&gt;
      &lt;/LinearLayout&gt;
  
      &lt;Space
          android:layout_weight="1"
          android:layout_width="match_parent"
          android:layout_height="0dp" /&gt;
  
      &lt;FrameLayout
          android:background="@color/back_end"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"&gt;
  
          ...
      &lt;/FrameLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>This is what it looks like:</p>
  
  <p><a href="https://i.stack.imgur.com/WqX64.png" rel="nofollow"><img src="https://i.stack.imgur.com/WqX64.png" alt="Cut off text"></a></p>
  
  <p>As you can see the button decides the height, not the text as should be.</p>
  
  <p>This is what I want it to look like:</p>
  
  <p><a href="https://i.stack.imgur.com/vQQuz.png" rel="nofollow"><img src="https://i.stack.imgur.com/vQQuz.png" alt="Text not cut off"></a></p>