Rectangle 27 0

How to add a floating button on scrolling in android?


<Button
    android:id="@+id/button_save"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Save" />

<ScrollView
    android:id="@+id/scrollView_list"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <LinearLayout
        android:id="@+id/linearLayout2"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >
    </LinearLayout>
</ScrollView>

If so, just add the Button OUTSIDE the ScrollView:

Perhaps I've misunderstand your question, but it sounds like you want a stationary Button outside of your ScrollView so that you can scroll and always see the Button?

Note
Rectangle 27 0

How to add a floating button on scrolling in android?


<Button
    android:id="@+id/button_save"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Save" />

<ScrollView
    android:id="@+id/scrollView_list"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <LinearLayout
        android:id="@+id/linearLayout2"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >
    </LinearLayout>
</ScrollView>

If so, just add the Button OUTSIDE the ScrollView:

Outside the button and scrollview, a relativelayout can be used to wrap. And the Button can be used with android:layout_alignParentBottom="true",android:layout_alignParentRight="true" to align to the rightbottom position of parent.

Perhaps I've misunderstand your question, but it sounds like you want a stationary Button outside of your ScrollView so that you can scroll and always see the Button?

Note