Krish
Krish

Reputation: 4232

How to set RelativeLayout parent right side

Hi I am very new for android and here I have created two RelativeLayout on LinearLayout

My requirement is I want to set second Relative Layout at parent right side

According to my code screen seems to be like my below image

So how can I set second RelativeLayout at parent right side

code:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:padding="5dp">

        <RelativeLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@android:color/holo_blue_light">

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="vertical">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="ItemCode"
                        android:textAppearance="?android:attr/textAppearanceMedium" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="5dp"
                        android:text=":"
                        android:textAppearance="?android:attr/textAppearanceMedium" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="5dp"
                        android:text="GG00929-023"
                        android:textAppearance="?android:attr/textAppearanceMedium" />

                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp"
                    android:orientation="horizontal">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Price"
                        android:textAppearance="?android:attr/textAppearanceMedium" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="5dp"
                        android:text=":"
                        android:textAppearance="?android:attr/textAppearanceMedium" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="5dp"
                        android:text="176000"
                        android:textAppearance="?android:attr/textAppearanceMedium" />

                </LinearLayout>

            </LinearLayout>

        </RelativeLayout>

        <RelativeLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_marginRight="0dp"
            android:background="@android:color/holo_red_light">

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="vertical">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="On Hand"
                        android:textAppearance="?android:attr/textAppearanceMedium" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="5dp"
                        android:text=":"
                        android:textAppearance="?android:attr/textAppearanceMedium" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="5dp"
                        android:text="372.89"
                        android:textAppearance="?android:attr/textAppearanceMedium" />

                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Reserve"
                        android:textAppearance="?android:attr/textAppearanceMedium" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="5dp"
                        android:text=":"
                        android:textAppearance="?android:attr/textAppearanceMedium" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="5dp"
                        android:text="0.68"
                        android:textAppearance="?android:attr/textAppearanceMedium" />

                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Cut Qty"
                        android:textAppearance="?android:attr/textAppearanceMedium" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="5dp"
                        android:text=":"
                        android:textAppearance="?android:attr/textAppearanceMedium" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="5dp"
                        android:text="0.00"
                        android:textAppearance="?android:attr/textAppearanceMedium" />

                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Balance"
                        android:textAppearance="?android:attr/textAppearanceMedium" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="5dp"
                        android:text=":"
                        android:textAppearance="?android:attr/textAppearanceMedium" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="5dp"
                        android:text="372.89"
                        android:textAppearance="?android:attr/textAppearanceMedium" />

                </LinearLayout>

            </LinearLayout>

        </RelativeLayout>

    </LinearLayout>

</LinearLayout>

enter image description here

Upvotes: 0

Views: 1741

Answers (7)

anonymous
anonymous

Reputation: 386

Try this code ::

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:weightSum="2"
        android:padding="5dp">

        <RelativeLayout
            android:layout_weight="1"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:background="@android:color/holo_blue_light">

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="vertical">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="ItemCode"
                        android:textAppearance="?android:attr/textAppearanceMedium" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="5dp"
                        android:text=":"
                        android:textAppearance="?android:attr/textAppearanceMedium" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="5dp"
                        android:text="GG00929-023"
                        android:textAppearance="?android:attr/textAppearanceMedium" />

                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp"
                    android:orientation="horizontal">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Price"
                        android:textAppearance="?android:attr/textAppearanceMedium" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="5dp"
                        android:text=":"
                        android:textAppearance="?android:attr/textAppearanceMedium" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="5dp"
                        android:text="176000"
                        android:textAppearance="?android:attr/textAppearanceMedium" />

                </LinearLayout>

            </LinearLayout>

        </RelativeLayout>

        <RelativeLayout
             android:layout_weight="1"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_marginRight="0dp"
            android:background="@android:color/holo_red_light">

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="vertical">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="On Hand"
                        android:textAppearance="?android:attr/textAppearanceMedium" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="5dp"
                        android:text=":"
                        android:textAppearance="?android:attr/textAppearanceMedium" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="5dp"
                        android:text="372.89"
                        android:textAppearance="?android:attr/textAppearanceMedium" />

                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Reserve"
                        android:textAppearance="?android:attr/textAppearanceMedium" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="5dp"
                        android:text=":"
                        android:textAppearance="?android:attr/textAppearanceMedium" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="5dp"
                        android:text="0.68"
                        android:textAppearance="?android:attr/textAppearanceMedium" />

                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Cut Qty"
                        android:textAppearance="?android:attr/textAppearanceMedium" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="5dp"
                        android:text=":"
                        android:textAppearance="?android:attr/textAppearanceMedium" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="5dp"
                        android:text="0.00"
                        android:textAppearance="?android:attr/textAppearanceMedium" />

                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Balance"
                        android:textAppearance="?android:attr/textAppearanceMedium" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="5dp"
                        android:text=":"
                        android:textAppearance="?android:attr/textAppearanceMedium" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="5dp"
                        android:text="372.89"
                        android:textAppearance="?android:attr/textAppearanceMedium" />

                </LinearLayout>

            </LinearLayout>

        </RelativeLayout>

    </LinearLayout>

</LinearLayout>

enter image description here

Upvotes: 0

Eliran Tutia
Eliran Tutia

Reputation: 736

You have few ways to do what you require. Ill give you 2.

  • First you can change the "Parent Layout" to Relative and add alignParentRight="true" and alignParentLeft="true" for the two LinearLayout.
  • Second, with the way you did it, you can change to width of the two LinearLayout to 0dp and then, add them layout_weight="1".

Upvotes: 0

Linh
Linh

Reputation: 61009

Try it in second RelativeLayout

<RelativeLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="right"
            android:layout_marginRight="0dp"
            android:background="@android:color/holo_red_light">

android:layout_alignParentRight attribute only work in children of RelativeLayout. Now, you are using it in a child of a LinearLayout so it will not work.

Upvotes: 0

ozo
ozo

Reputation: 761

In order to use android:layout_alignParentRight="true", the parent should be RelativeLayout. The parent of your RelativeLayout is LinearLayout and if I'm not mistaken, you want that RelativeLayout to be at the right of parent. Either make the parent RelativeLayout, or give weight_sum to LinearLayout and weight to the children.

Upvotes: 0

Ramesh Kumar
Ramesh Kumar

Reputation: 1229

Linear Layout has no such attribute to set Right: So you have to add the view with weight which will coverup the middle blank space.

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:padding="5dp">

    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@android:color/holo_blue_light">

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="ItemCode"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dp"
                    android:text=":"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dp"
                    android:text="GG00929-023"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="10dp"
                android:orientation="horizontal">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="Price"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dp"
                    android:text=":"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dp"
                    android:text="176000"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

            </LinearLayout>

        </LinearLayout>

    </RelativeLayout>

    <View
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1" />

    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_marginRight="0dp"
        android:background="@android:color/holo_red_light">

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="On Hand"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dp"
                    android:text=":"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dp"
                    android:text="372.89"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="Reserve"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dp"
                    android:text=":"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dp"
                    android:text="0.68"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="Cut Qty"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dp"
                    android:text=":"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dp"
                    android:text="0.00"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="Balance"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dp"
                    android:text=":"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dp"
                    android:text="372.89"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

            </LinearLayout>

        </LinearLayout>

    </RelativeLayout>

</LinearLayout>

enter image description here

Upvotes: 1

earthw0rmjim
earthw0rmjim

Reputation: 19427

Between the two RelativeLayout, insert a third View:

<View
    android:layout_width="0dp"
    android:layout_height="0dp"
    android:layout_weight="1" />

Because of it's layout weight, this will "push" your second RelativeLayout to the right side.

Upvotes: 0

Jay Rathod
Jay Rathod

Reputation: 11255

Try this Layout. I have applied some changes to your Layout. I have remove child Linear Layout because it is useless or android:layout_alignParentRight="true" will not get affected. Also added Relative Layout as your Root Layout.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal">


    <RelativeLayout
        android:id="@+id/RL1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@android:color/holo_blue_light">

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="ItemCode"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dp"
                    android:text=":"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dp"
                    android:text="GG00929-023"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="10dp"
                android:orientation="horizontal">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="Price"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dp"
                    android:text=":"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dp"
                    android:text="176000"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

            </LinearLayout>

        </LinearLayout>

    </RelativeLayout>

    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:background="@android:color/holo_red_light">

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="On Hand"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dp"
                    android:text=":"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dp"
                    android:text="372.89"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="Reserve"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dp"
                    android:text=":"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dp"
                    android:text="0.68"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="Cut Qty"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dp"
                    android:text=":"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dp"
                    android:text="0.00"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="Balance"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dp"
                    android:text=":"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dp"
                    android:text="372.89"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

            </LinearLayout>

        </LinearLayout>
    </RelativeLayout>

</RelativeLayout>

Upvotes: 3

Related Questions