android - Show Button in LinearLayout always on Bottom of the screen while Scrolling -
i have linearlayout few elements in scrollview. want have button on bottom of screen (not on bottom of scrollview), shown in front, while scrolling rest of content of layout. how can achieve this?
this scrollview:
<scrollview xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:fillviewport="true" android:background="#e2e2e2"> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/bgnlayout" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <include layout="@layout/trelement" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="16dp" /> <linearlayout android:id="@+id/stopslayout" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:layout_margin="16dp" android:showdividers="middle" android:divider="@drawable/divider"> </linearlayout> </linearlayout> </scrollview>
and thats part in code add current button (which shown on bottom of scrollview):
button mpbtn = buttonfactory.makebutton(m, r.string.openmap, r.color.androidblue); linearlayout bgnlayout = (linearlayout) rootview.findviewbyid(r.id.bgnlayout); bgnlayout.addview(mpbtn);
i appreciate help.
if can add button xml it's possible , can make button visible , invisible when wish inside activity class.
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/parentlayout" android:layout_width="match_parent" android:layout_height="match_parent" > <scrollview android:layout_width="fill_parent" android:layout_height="fill_parent" android:fillviewport="true" android:background="#e2e2e2"> ///// </scrollview> <button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentbottom="true" /> </relativelayout>
Comments
Post a Comment