Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to create Floating action button using single LinearLayout layout

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 385
    Comment on it

    Hello Friends,
    In my last blog I have explained about how to create floating action button using CoordinatorLayout, LinearLayout, TextView and FloatingActionButton. But in this tutorial I have created a new floating action button layout using single LinearLayout.
    You can see the below example it will clearly describe you how to create Floating action button layout in android.

    <android.support.design.widget.CoordinatorLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
    
    
            <LinearLayout
                android:id="@+id/viewA"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
    
                android:background="@android:color/holo_purple"
                android:orientation="horizontal">
    
        </LinearLayout>
    
        <android.support.design.widget.FloatingActionButton
            android:id="@+id/fab"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="16dp"
            android:clickable="true"
            android:src="@drawable/icon2"
            app:layout_anchor="@id/viewA"
            app:layout_anchorGravity="bottom|end|right"/>
    
    </android.support.design.widget.CoordinatorLayout>
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: