How do you disable a PreferenceScreen's scrolling so that it would take up the whole space?
Here's the setup.. I have a Fragment which have a ScrollView as its main (root) view, inside is a LinearLayout which contains two Fragments (FrameLayout). The first one is a PreferenceFragment, the other is just a Fragment containing a View and a ListView. I want the PreferenceScreen to take up the whole space so that the whole thing scrolls as one.
Here's the code
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="2"
android:orientation="vertical">
<FrameLayout
android:id="@+id/preferences_frame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
</FrameLayout>
<FrameLayout
android:id="@+id/services_edit_frame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
</FrameLayout>
</LinearLayout>
</ScrollView>
Thanks a lot!
To hide the scrollbar and disable scrolling, we can use the CSS overflow property. This property determines what to do with content that extends beyond the boundaries of its container. To prevent scrolling with this property, just apply the rule overflow: hidden to the body (for the entire page) or a container element.
it is too late but for some one who looking for the right answer. in your PreferenceFragmentCompat
class just override the onAvtivityCreated
method like below.
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
getListView().setOverScrollMode(View.OVER_SCROLL_NEVER);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With