Search code examples
androidandroid-layoutandroid-toolbarpreferencepreferencescreen

Android PreferenceScreen overlay Toolbar


Android PreferenceScreen overlay Toolbar. I have tried to use padding and margin to set Preference Screen under the Toolbar but no any success.

NOTE: after changing Toolbar with ActionBar it works as expected.

Any help please.

Thanks, Hrach


Solution

  • I just now resolve the issue:

    Here is the code:

    <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">
    
            <include layout="@layout/app_toolbar"
                 android:id="@+id/app_toolbar" />
    
            <FrameLayout
                android:id="@+id/pref_content"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/app_toolbar" />
    
            <!-- The main content view -->
            <FrameLayout
                android:id="@+id/content_frame"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:paddingTop="?attr/actionBarSize"/>
    
        </RelativeLayout>
    

    After adding the fist FrameLayout the issue is resolved.

    Thanks