Vladislav Dmitriev Vladislav Dmitriev - 5 months ago 13
Android Question

Rectangle at the bottom of the activity

enter image description here

Trying to study Android Studio. How can I create bottom rectangle with "Log in" text? And silly question about tabs. Is that correct, that I move them with marginTop property?

Answer

Use that Layout:

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

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="0.90">

    </LinearLayout>

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="0.10"
        android:background="#ffFF9800"
        android:layout_gravity="center_vertical">

        <LinearLayout
            android:orientation="horizontal"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_gravity="right"
            android:layout_marginRight="20dp">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="LOG IN >"
                android:id="@+id/textView76"
                android:textSize="20sp"
                android:textColor="#fff"
                android:layout_gravity="center_vertical"/>
        </LinearLayout>
    </LinearLayout>


</LinearLayout>