Layout that occupies the entire screen in any terminal

1

I find that when trying my app on the mobile, or when changing the emulator with other larger dimensions. there is a screen, that is to say that the screen remains blank. And if I emulate or try in smaller terminals, it is cut What guidelines do I have to follow so that regardless of the terminal that opens the app, occupy the entire screen? Use the "dp" units of measure

Before updating Android Studio, just after creating a project the layouts had a RelativeLayout and inside playing with layout_below regardless of which terminal emulate was always good.

Now after updating I do not see that option layout_below

EDIT: I'm seeing that there are some folders in res with the different combinations of screen size, width, height, and density of the screens.

Does anyone know or know where to consult, all the folders with the possible combinations of sizes and densities ?? to just have to make the layouts of all combinations

EDIT: I found this:

Does it mean that I have to do all the convincing?

Examples:

layout-large-ldpi layout-large-mdpi layout-large-hdpi layout-large-xdpi layout-large-xxdpi layout-large-xxxdpi

layput-xlarge-ldpi layput-xlarge-mdpi layput-xlarge-hdpi layput-xlarge-xdpi layput-xlarge-xxdpi layput-xlarge-xxxdpi

Would I have to do all those layout and go designing each of them so that it looks on any device correctly?

    
asked by Rodrypaladin 14.11.2018 в 18:26
source

1 answer

0

You can use the guidelines with percentage (at 25%, 50% and 75%) to anchor the ConstraintVerticales there and then give value to the height of the buttons with a wrap_contraint.

It would be something like this:

<Button
        android:text="1"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:id="@+id/button"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
        app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp" android:layout_marginBottom="8dp"
        app:layout_constraintBottom_toTopOf="@+id/button2"/>
<Button
        android:text="2"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:id="@+id/button2"
        android:layout_marginTop="8dp" app:layout_constraintStart_toStartOf="parent"
        android:layout_marginStart="8dp" app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
        android:layout_marginBottom="8dp" app:layout_constraintBottom_toTopOf="@+id/button3"
        app:layout_constraintTop_toTopOf="@+id/guideline4"/>
<Button
        android:text="3"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:id="@+id/button3" android:layout_marginTop="8dp"
        app:layout_constraintStart_toStartOf="parent"
        android:layout_marginStart="8dp" app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
        android:layout_marginBottom="8dp" app:layout_constraintBottom_toTopOf="@+id/button4"
        app:layout_constraintTop_toTopOf="@+id/guideline3"/>
<Button
        android:text="4"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:id="@+id/button4"
        android:layout_marginBottom="8dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp" android:layout_marginTop="8dp"
        app:layout_constraintStart_toStartOf="parent"
        android:layout_marginStart="8dp" app:layout_constraintTop_toTopOf="@+id/guideline"/>
<android.support.constraint.Guideline
        android:orientation="horizontal"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"  android:id="@+id/guideline4"
        app:layout_constraintGuide_percent="0.25"/>
<android.support.constraint.Guideline
        android:orientation="horizontal"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"  android:id="@+id/guideline"
        app:layout_constraintGuide_percent="0.75"/>
<android.support.constraint.Guideline
        android:orientation="horizontal"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"  android:id="@+id/guideline3"
        app:layout_constraintGuide_percent="0.5"/>
    
answered by 16.11.2018 в 09:13