Friday, November 1, 2019

How to make linearlayout horizontal Android

How to make linearlayout horizontal Android

create a layout: activity_layout.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"   
    xmlns:tools="http://schemas.android.com/tools"   
    android:id="@+id/LinearLayout1"   
    android:layout_width="match_parent"   
    android:layout_height="match_parent"   
    android:orientation="horizontal"> 
       
    <LinearLayout   
        android:layout_width="0dp"   
        android:layout_height="fill_parent"   
        android:background="#ADFF2F"   
        android:layout_weight="1"/>   
     
       
    <LinearLayout   
        android:layout_width="0dp"   
        android:layout_height="fill_parent"   
        android:background="#DA70D6"   
        android:layout_weight="2"/>   
       
</LinearLayout>  
Result  linearlayout horizontal Android below:
How to make linearlayout horizontal Android

No comments:

Post a Comment