java - Floating Action Button over Scrollview? -
i'm revamping app follow more "material design-ey", have run trouble fab. have scrollview 2 floating action buttons:
when scroll bottom, fabs cover content. want able scroll little past bottom fabs can align_parent_bottom
without overlapping anything:
(should able scroll little more fabs aligned below)
how create space @ bottom of app after scrolling down max fabs rest?
<?xml version="1.0" encoding="utf-8"?> <relativelayout 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="wrap_content" android:background="#68d9cc"> <scrollview android:layout_width="match_parent" android:layout_height="match_parent" android:fillviewport="true"> <relativelayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#68d9cc"> <android.support.v7.widget.toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionbarsize" android:background="@color/colorprimary" android:elevation="20dp" android:theme="@style/themeoverlay.appcompat.actionbar" app:popuptheme="@style/themeoverlay.appcompat.light"> <imageview android:layout_height="match_parent" android:layout_width="wrap_content" android:id="@+id/back" android:onclick="cancel" android:src="@drawable/ic_arrow_back_black_24dp" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="test example" android:textsize="22sp" android:id="@+id/header" android:textcolor="@color/textcolorprimary" android:layout_gravity="center" android:paddingright="10dp" /> </android.support.v7.widget.toolbar> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:id="@+id/linear" android:layout_marginbottom="55dp" android:layout_below="@+id/textview12" android:layout_alignparentleft="true" android:layout_alignparentstart="true"> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textsize="20sp" android:textcolor="@android:color/black" android:layout_below="@+id/textview12" android:text="textview:" android:layout_alignparentleft="true" android:layout_alignparentstart="true" /> <edittext android:id="@+id/edittext" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignbaseline="@+id/textview4" android:layout_alignbottom="@+id/textview4" android:layout_toendof="@+id/textview4" android:layout_torightof="@+id/textview4" android:imeoptions="actiondone" android:inputtype="text" /> </linearlayout> <listview android:id="@+id/listview" android:layout_width="wrap_content" android:choicemode="singlechoice" android:layout_height="300dp" android:layout_below="@+id/toolbar" android:layout_alignparentleft="true" android:layout_alignparentstart="true" android:elevation="9dp"> </listview> <textview android:id="@+id/textview12" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margintop="78dp" android:gravity="center_horizontal" android:text="textview" android:textcolor="#000000" android:textsize="18sp" android:layout_below="@+id/listview" android:layout_alignparentleft="true" android:layout_alignparentstart="true" /> </relativelayout> </scrollview> <android.support.design.widget.floatingactionbutton android:id="@+id/cancel" android:onclick="cancel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentbottom="true" android:layout_alignparentleft="true" android:layout_alignparentstart="true" android:clickable="true" app:fabsize="normal" app:srccompat="@drawable/ic_close_black_24dp" /> <android.support.design.widget.floatingactionbutton android:id="@+id/done" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentbottom="true" android:layout_alignparentend="true" android:layout_alignparentright="true" android:clickable="true" app:fabsize="normal" app:srccompat="@drawable/ic_done_black_24dp" /> </relativelayout>
if aiming material design mentioned, putting floating action button not encouraged. either stack them on top of each other on right, or have 1 open multiple mini fab on click.
an easy fix can think of here add paddingbottom layout have more "content" , scroll more.
i read section if haven't already.
https://material.io/guidelines/components/buttons-floating-action-button.html#
Comments
Post a Comment