Tablayout crashed after changing compiled sdk version from 23 to 24
I already had my app with tablayout working perfectly. But after changing the compiled version of sdk from 23 to 24, there is a small gap in the second tab.
It should look like this.
But it looks like a black gap.
Can anyone tell me how to fix this?
Both of these tabs use the same layout.
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer_layout"
android:layout_width="match_parent" android:layout_height="match_parent"
android:fitsSystemWindows="true" tools:openDrawer="start">
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent" android:fitsSystemWindows="true"
tools:context=".MainActivity">
<android.support.design.widget.AppBarLayout android:layout_height="wrap_content"
android:layout_width="match_parent" android:theme="@style/AppTheme.AppBarOverlay">
</android.support.design.widget.AppBarLayout>
<include layout="@layout/dashboard" />
</android.support.design.widget.CoordinatorLayout>
<android.support.design.widget.NavigationView android:id="@+id/nav_view"
android:layout_width="wrap_content" android:layout_height="match_parent"
android:layout_gravity="start" android:fitsSystemWindows="true"
app:itemTextColor="@color/drawer_text_color"
app:headerLayout="@layout/nav_header_main" app:menu="@menu/activity_main_drawer" />
dashboard.xml
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginTop="10dp">
<ProgressBar
android:id="@+id/progbar"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center"
/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/txt"
android:text="These are your active court Proceedings"
android:paddingBottom="10dp"/>
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#D9DCDE"
android:scrollbars="vertical">
</android.support.v7.widget.RecyclerView>
</LinearLayout>
</FrameLayout>
Hope my question is clear. Please give me a solution for this. Thank.
source to share
From Documentation
Android: fitsSystemWindows
A boolean internal attribute to customize the view layout based on the window system, such as the status bar. If true, adjust the padding of this to leave space for system windows. Will take effect if this view is for a non-inline activity.
so set *android:fitsSystemWindows = "false"
for DrawerLayout
andCoordinatorLayout
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="false"
tools:openDrawer="start">
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="false"
tools:context=".MainActivity">
</android.support.design.widget.CoordinatorLayout>
</android.support.v4.widget.DrawerLayout>
source to share