title: Android TextView with maxwidth
body: <p>I have an TextView with a variable width, but maximum is 250dp. But somehow Android sets it always to maxwidth.</p>
  
  <p>With a shorter text and without maxwidth it works, but then the text is long enough that the field exceeds the screen width, it overlaps the arrow.</p>
  
  <p><img src="https://i.stack.imgur.com/1S6ba.png" alt="enter image description here"></p>
  
  <p>I already tried this two variants, which give the same result as in the picture</p>
  
  <pre><code>&lt;TextView
      android:id="@+id/bubbleText"
      style="@style/MarkerText"
      android:maxWidth="250dp"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:background="#FF0000"
      android:layout_marginEnd="@dimen/defaultSpacing" /&gt;
  
  &lt;TextView
      android:id="@+id/bubbleText"
      style="@style/MarkerText"
      android:layout_width="0dp"
      android:layout_height="wrap_content"
      android:layout_marginEnd="@dimen/defaultSpacing"
      android:layout_weight="1"
      android:background="#FF0000"
      android:maxWidth="250dp"
      android:singleLine="false" /&gt;
  </code></pre>
  
  <p>I want it to look like this:</p>
  
  <p><img src="https://i.stack.imgur.com/2WZ1j.png" alt="enter image description here"></p>
  
  <p>Additional infos:</p>
  
  <p>Complete XML </p>
  
  <pre><code>&lt;LinearLayout
      android:id="@+id/markerTextBubble"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:gravity="center"
      android:orientation="vertical"
      android:visibility="invisible" &gt;
  
      &lt;LinearLayout
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:background="@drawable/marker_text_background" &gt;
  
          &lt;LinearLayout
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:orientation="horizontal"
              android:paddingBottom="@dimen/tinySpacing"
              android:paddingEnd="@dimen/defaultSpacing"
              android:paddingStart="@dimen/defaultSpacing"
              android:paddingTop="@dimen/tinySpacing" &gt;
  
              &lt;TextView
                  android:id="@+id/bubbleText"
                  style="@style/MarkerText"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_marginEnd="@dimen/defaultSpacing"
                  android:background="#FF0000"
                  android:maxWidth="250dp" /&gt;
  
              &lt;mypackage.IconTextView
                  xmlns:android="http://schemas.android.com/apk/res/android"
                  style="@style/MarkerTextIcon"
                  android:layout_width="wrap_content"
                  android:layout_height="match_parent"
                  android:gravity="center"
                  android:text="@string/icon_map_arrow" /&gt;
          &lt;/LinearLayout&gt;
      &lt;/LinearLayout&gt;
  
      &lt;ImageView
          android:layout_width="20dp"
          android:layout_height="20dp"
          android:layout_marginBottom="-5dp"
          android:layout_marginTop="-1dp"
          android:src="@drawable/marker_text_background_rectangle" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  
  
  <pre><code>&lt;style name="MarkerText" parent="android:Widget.Holo.Light.TextView"&gt;
      &lt;item name="android:textColor"&gt;@color/myWhite&lt;/item&gt;
      &lt;item name="android:textSize"&gt;@dimen/markerTextSize&lt;/item&gt;
  &lt;/style&gt;
  
  &lt;dimen name="markerTextSize"&gt;22sp&lt;/dimen&gt;
  </code></pre>
  
  <p>The problem occurs in this independent snippet too:</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="wrap_content"
      android:layout_height="wrap_content"
      android:background="#FF0000"
      android:maxWidth="250dp"
      android:text="1. Willkommen bei meiner APP"
      android:textSize="22sp" /&gt;
  </code></pre>