android - How to set Save/Cancel pinned at the bottom of activity? -
i wonder if there simple way of making save/cancel buttons in bottom of activity one:
calendar (add new event) lg v10
thanks in advance!
do this....(tested)
<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent"> <scrollview android:id="@+id/scrollablecontents" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_above="@id/footer"> //put views here </scrollview> <relativelayout android:id="@+id/footer" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignparentbottom="true" android:gravity="center"> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:weightsum="2"> <button android:id="@+id/savebutton" android:layout_width="fill_parent" android:layout_height="40dp" android:layout_margin="0dp" android:layout_marginbottom="20dp" android:text="save" android:textsize="20sp" android:textcolor="#ffffff" android:layout_weight="1"/> <button android:id="@+id/cancelbutton1" android:layout_width="fill_parent" android:layout_height="20dp" android:layout_margin="0dp" android:layout_marginbottom="20dp" android:text="cancel" android:textsize="20sp" android:textcolor="#ffffff" android:layout_weight="1"/> </linearlayout> </relativelayout> </relativelayout>
Comments
Post a Comment