title: Restrict the Width of an Android Horizontal ScrollView with nested TextView
body: <p>I've written the below code for a custom adapter of a list view. This is my row_item.xml </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:orientation="vertical"
  android:padding="10dp"&gt;
  
  
  &lt;HorizontalScrollView
      android:layout_width="300dp"
      android:layout_height="24dp"
      android:id="@+id/horizontalScrollView"&gt;
  
      &lt;TextView
          android:id="@+id/title"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:text="111111111111111111111111111111111111111111111111111111"
          android:textAppearance="@style/TextAppearance.AppCompat.Headline"
          android:layout_alignParentTop="true"
          android:layout_alignParentStart="true"
          android:scrollHorizontally="true"
          android:maxLines = "1"
          android:textSize="18sp" /&gt;
  
  &lt;/HorizontalScrollView&gt;
  
  
  
  &lt;TextView
      android:id="@+id/price"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_below="@+id/horizontalScrollView"
      android:layout_marginTop="5dp"
      android:text="$39.99"
      android:textColor="@android:color/black" /&gt;
  
  
  
  &lt;ImageView
      android:id="@+id/store"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:src="@drawable/ic_favorite_border_black_24dp"
      android:layout_centerVertical="true"
      android:layout_alignParentEnd="true"
      android:layout_marginEnd="16dp" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>I have put the text view in the horizontal scroll view because a lot of the text items are very long. The above code does make it scroll left to right and restrict it to one line, however I want the scrollView to end just before the imageView. Below is a picture of the desired functionality:</p>
  
  <p><a href="https://i.stack.imgur.com/ZuR7s.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZuR7s.png" alt="Visual Aid"></a></p>
  
  <p>However when I run the app, the text bleeds over directly on top of the imageView.</p>
  
  <p>Any ideas on how to correct this?</p>
  
  <p>Update 1: Here's what I am currently getting:</p>
  
  <p><a href="https://i.stack.imgur.com/aFWjp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aFWjp.png" alt="Visual Aid"></a></p>