Problem mounting Textviews on Android Studio

Asked

Viewed 178 times

0

I am creating a project in Android Studio, the preview did not turn out as I expected and I would like to know where I went wrong.

Here is the XML:

<?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">


 <TextView
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     android:text="Calculadora"/>


   <TextView
       android:layout_width="fill_parent"
       android:layout_height="wrap_content"
       android:text="Digite o Primeiro Numero"/>


    <EditText
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android.id="@+calculo/numero1"/>

    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Digite o Segundo Numero"/>

    <EditText
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android.id="@+calculo/numero2"/>

<Button
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android.id="@+botao/btsoma"
    android:text="somar"/>



    <EditText
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android.id="@+calculo/resultado"/>


</LinearLayout>

The visualization was supposed to look like this:

But the result is that only appeared the calculator name.

1 answer

1

When orientation is not specified, default horizontal and in this case should be vertical.

<?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">
...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.