How to fix LinearLayout



  • There's a lyment for ListView. There's progress in the bar on the left edge, and there's a button on the right side and a text field on the linearLayout. And there is a LinearLayout in which there are two text fields in which the length of the text may differ. Question: How can this LinearLayout be recorded in such a way that the text does not go to the button on the right of it, but simply move the text to a new line.

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        xmlns:custom="http://schemas.android.com/apk/res-auto"
        android:background="@color/colorPrimary"
        android:orientation="horizontal"
        android:padding="5dip"
        >
    
    &lt;!--  ListRow Left sied Progress Bar --&gt;
    &lt;LinearLayout android:id="@+id/progressbar"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:padding="3dip"
        android:layout_alignParentLeft="true"
        android:layout_marginRight="5dip"&gt;
    
        &lt;com.github.lzyzsd.circleprogress.DonutProgress
            android:id="@+id/donut_progress"
            android:layout_width="80dp"
            android:layout_height="80dp"
            custom:donut_progress="30" /&gt;
    
    &lt;/LinearLayout&gt;
    
    &lt;!-- Title of package--&gt;
    &lt;LinearLayout
        android:orientation="vertical"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@+id/btnBuy"
        android:layout_toRightOf="@+id/progressbar"
        android:layout_toEndOf="@+id/progressbar"&gt;
    
        &lt;TextView
            android:id="@+id/title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Rihanna Love the way"
            android:textColor="#040404"
            android:typeface="sans"
            android:textSize="20dip"
            android:textStyle="bold"
            android:layout_below="@+id/description"
            android:layout_toRightOf="@+id/progressbar" /&gt;
    
        &lt;TextView
            android:id="@+id/description"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:textColor="#343434"
            android:textSize="15dip"
            android:text="Just gona stand there and ..."
            android:layout_centerVertical="true"
            android:layout_toRightOf="@+id/progressbar"
            android:layout_toEndOf="@+id/progressbar" /&gt;
    
    &lt;/LinearLayout&gt;
    
    
    
    &lt;!-- Buy button --&gt;
    &lt;Button
        android:id="@+id/btnBuy"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="BUY 4:45"
        android:textStyle="bold"
        android:layout_alignParentTop="true"
        android:layout_alignParentRight="true"
        /&gt;
    
    &lt;!-- Short description about package --&gt;
    &lt;TextView android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="random text"
        android:id="@+id/count"
        android:layout_alignParentRight="true"
        android:layout_below="@+id/btnBuy"
    
        /&gt;
    

    </RelativeLayout>



  • Just replacing the parent element with LinearLayout c android:orientation="horizontal" and the last button and text field, too. LinearLayout Turn around, but with android:orientation="vertical"




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2