The tab is going through the reset button

Asked

Viewed 48 times

1

I wanted the tab to stop just below the FREE THROW buttons, not at the bottom of the screen. How Do I Fix So Design Is Responsive?

Because the content gets messy when the screen is in Landscape mode?

Tela em modo portrait

Tela em modo landscape

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal"
    tools:context="com.example.android.courtcount.MainActivity">

    <LinearLayout
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:orientation="vertical">

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="16dp"
            android:fontFamily="sans-serif-medium"
            android:gravity="center_horizontal"
            android:text="Team A"
            android:textColor="#616161"
            android:textSize="14sp" />

        <TextView
            android:id="@+id/team_a_score"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="24dp"
            android:fontFamily="sans-serif-light"
            android:gravity="center_horizontal"
            android:text="0"
            android:textSize="56sp" />

        <Button
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="8dp"
            android:onClick="add3CurrentTeamAScore"
            android:text="+3" />

        <Button
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="8dp"
            android:onClick="add2CurrentTeamAScore"
            android:text="+2" />


        <Button
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:onClick="add1CurrentTeamAScore"
            android:text="Free Throw" />

    </LinearLayout>

    <View
        android:layout_width="1dp"
        android:layout_height="wrap_content"
        android:layout_marginLeft="24dp"
        android:layout_marginRight="24dp"
        android:background="@android:color/darker_gray"></View>

    <LinearLayout
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:orientation="vertical">

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="16dp"
            android:fontFamily="sans-serif-medium"
            android:gravity="center_horizontal"
            android:text="Team B"
            android:textColor="#616161"
            android:textSize="14sp" />

        <TextView
            android:id="@+id/team_b_score"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="24dp"
            android:fontFamily="sans-serif-light"
            android:gravity="center_horizontal"
            android:text="0"
            android:textSize="56sp" />

        <Button
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="8dp"
            android:onClick="add3CurrentTeamBScore"
            android:text="+3" />

        <Button
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="8dp"
            android:onClick="add2CurrentTeamBScore"
            android:text="+2" />


        <Button
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:onClick="add1CurrentTeamBScore"
            android:text="Free Throw" />

    </LinearLayout>

</LinearLayout>

<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true"
    android:onClick="resetScores"
    android:text="Reset" />

  • You could create a layout in Landscape.. just create a "layout-land" folder and make your custom xml inside, then you can save a space from the "Team" label".

1 answer

1

You could create a folder called "layout-land", inside you add new layout files that will be used when the phone is in Landscape.

It is difficult to create an xml that fits all devices and vertical/horizontal by a number of factors, among them, the most striking was the size of the screens of other devices.

Browser other questions tagged

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