Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable a PreferenceScreen's Scrolling

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!

like image 613
Matthew Avatar asked Jul 24 '15 02:07

Matthew


People also ask

How do you make a CSS page not scrollable?

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.


1 Answers

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);
    }
like image 121
M.J.Ahmadi Avatar answered Oct 03 '22 11:10

M.J.Ahmadi