RelativeLayout position below RelativeLayout

RelativeLayout in Android Studio

I have a horizontal LinearLayout in which I have a RelativeLayout, and I want another RelativeLayout to be below it, as well as in the whole XML file, but the layout appears directly to the right of the previous layout

I tried setting the top edge of the RelativeLayout to a specific random value, like 60 seconds, which it takes below the previous RelativeLayout, but when I add a TextView, the TextView does not appear in the design view

After adding textview to RelativeLayout

How to place a position below the previous RelativeLayout? as well as how to add TextViews to this RelativeLayout and display them?

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/calcbackground"
android:weightSum="1">

<RelativeLayout
    android:layout_width="fill_parent"
    android:layout_height="53dp"
    >

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:text="SHIFT"
        android:id="@+id/shifttextiew"
        android:layout_alignParentTop="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:text="DEG"
        android:id="@+id/degtextview"
        android:layout_alignParentTop="true"
        android:layout_toRightOf="@+id/shifttextiew"
        android:layout_toEndOf="@+id/shifttextiew"
        android:layout_marginLeft="31dp"
        android:layout_marginStart="31dp" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:text="RAD"
        android:id="@+id/radtextview"
        android:layout_alignParentTop="true"
        android:layout_toRightOf="@+id/degtextview"
        android:layout_toEndOf="@+id/degtextview"
        android:layout_marginLeft="30dp"
        android:layout_marginStart="30dp" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:text="GRAD"
        android:id="@+id/gradtextview"
        android:layout_alignParentTop="true"
        android:layout_toRightOf="@+id/radtextview"
        android:layout_toEndOf="@+id/radtextview"
        android:layout_marginLeft="41dp"
        android:layout_marginStart="41dp" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:text="12345678910"
        android:id="@+id/calculationtextview"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_below="@+id/shifttextiew"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true" />

</RelativeLayout>

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginTop="60sp">

</RelativeLayout>

</LinearLayout>
+4
5

, , : android:orientation="horizontal".

LinearLayout .

+3

, layout layout,

0

(LinearLayout)

android:orientation="vertical"  

android:orientation="horizontal"
0

use orientation = "vertical"

0

, . - , . , . .

  android:orientation="vertical" 
0

Source: https://habr.com/ru/post/1622333/


All Articles