android - Positioning FloatingActionButton at fixed position -


i know asked question , i've read lot of questions it, i'm having issues positioning floatingactionbutton on bottom right corner of layout.


this xml:

<?xml version="1.0" encoding="utf-8"?> <layout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto">  <data>      <variable         name="viewmodel"         type="myapplication.viewmodels.viewmodel" /> </data>  <framelayout     android:layout_width="match_parent"     android:layout_height="match_parent">      <scrollview         android:layout_width="match_parent"         android:layout_height="wrap_content">          <relativelayout             android:layout_width="match_parent"             android:layout_height="match_parent"             android:padding="10dp">              //some fields          </relativelayout>      </scrollview>      <android.support.design.widget.floatingactionbutton         android:id="@+id/fabpost"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_alignparentbottom="true"         android:layout_alignparentend="true"         android:layout_gravity="bottom|end"         android:layout_margin="16dp"         android:src="@drawable/ic_send_white_24dp"         android:tint="@color/colorwhite"         app:backgroundtint="@color/colorprimarydark" />  </framelayout>  </layout> 

i've tried framelayout, coordinatorlayout , relativelayout, neither seems work. have fact i'm using databinding , therefore layout tag?

funny thing in android studio preview fab located should be, on phone isn't.

below 2 screenshots.

android studio:

android studio

phone:

phone


thanks in advance!


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -