Android Studio Layout Linear Horizontal Example

Here is an example of android studio linear horizontal layout

Design View


Text View

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

    <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:hint="@string/title_horizontal" 
       android:textColor="@color/colorPrimary" 
       android:textSize="26sp" 
       android:layout_marginLeft="30dp"/>

    <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="match_parent"
       android:orientation="horizontal">
        <Button 
           android:layout_width="wrap_content" 
           android:layout_height="match_parent" 
           android:text="@string/str_btn1"/>

        <Button 
           android:layout_width="wrap_content" 
           android:layout_height="match_parent" 
           android:text="@string/str_btn2"/>

        <Button 
           android:layout_width="wrap_content" 
           android:layout_height="match_parent" 
           android:text="@string/str_btn3"/>

        <Button 
           android:layout_width="wrap_content" 
           android:layout_height="match_parent" 
           android:text="@string/str_btn4"/>

        <Button 
           android:layout_width="wrap_content" 
           android:layout_height="match_parent" 
           android:text="@string/str_btn5"/>

    </LinearLayout>
</LinearLayout>

Tidak ada komentar