android - Fixed button at the bottom of the view -
i trying have button (or buttons) @ bottom of view, , else in scrollview.
whatever do, still can't have button fixed @ bottom (the yellow rectangle @ bottom of pic), don't understand why.
here's code:
<?xml version="1.0" encoding="utf-8"?> <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" android:orientation="vertical"> <android.support.design.widget.appbarlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/themeoverlay.appcompat.dark.actionbar"> <android.support.v7.widget.toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionbarsize" android:background="?attr/colorprimary" app:layout_scrollflags="scroll|enteralways" app:popuptheme="@style/themeoverlay.appcompat.light" /> </android.support.design.widget.appbarlayout> <relativelayout android:layout_width="match_parent" android:layout_height="wrap_content" app:layout_behavior="@string/appbar_scrolling_view_behavior"> <textview android:id="@+id/txt_title" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/light_rose" android:padding="20dp" android:text="contact" android:textcolor="@android:color/white" android:textsize="30dp" /> <scrollview android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_above="@+id/footer" android:layout_below="@+id/txt_title" android:background="#0000ff" android:fillviewport="true"> <textview android:id="@+id/texthere" android:layout_width="160dp" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:gravity="center_vertical|center_horizontal" android:text="test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test" android:textsize="35sp"></textview> </scrollview> <relativelayout android:id="@+id/footer" android:layout_width="match_parent" android:layout_height="100dp" android:layout_alignparentbottom="true" android:background="#ffff00"> <textview android:id="@+id/texthere2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerhorizontal="true" android:layout_centervertical="true" android:text="things in footer here" android:textsize="20sp" /> </relativelayout> </relativelayout> </android.support.design.widget.coordinatorlayout>
see screenshot:
can give me hint?
instead of fixing button on bottom of view use bottom navigation bar. it's more appealing , attractive. must have seen bottom tabs on whatsapp, facebook , linkedin etc apps. it's , it's pretty easy too.
just follow link https://github.com/roughike/bottombar
or if want can share working code you. luck.
Comments
Post a Comment