android - App bar items collapsing with status bar when scrolled.And app not being scrolled on scrolling list items -


<?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.coordinatorlayout 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/main_content" android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true" tools:context="com.chandan.halo.mainactivity" >  <android.support.design.widget.appbarlayout     android:id="@+id/appbar"     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:paddingtop="@dimen/appbar_padding_top"     android:theme="@style/apptheme.appbaroverlay">      <android.support.v7.widget.toolbar         android:id="@+id/toolbar"         android:layout_width="match_parent"         android:layout_height="?attr/actionbarsize"         android:background="?attr/colorprimary"         app:layout_scrollflags="scroll|enteralways"         app:popuptheme="@style/apptheme.popupoverlay"         >     </android.support.v7.widget.toolbar>      <android.support.design.widget.tablayout         android:id="@+id/tabs"         android:layout_width="match_parent"         android:layout_height="wrap_content"         />  </android.support.design.widget.appbarlayout>  <android.support.v4.view.viewpager     android:id="@+id/container"     android:layout_width="match_parent"     android:layout_height="match_parent"     app:layout_behavior="@string/appbar_scrolling_view_behavior" />  <android.support.design.widget.floatingactionbutton     android:id="@+id/fab"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_gravity="end|bottom"     android:layout_margin="@dimen/fab_margin"     android:src="@android:drawable/ic_dialog_email" />  </android.support.design.widget.coordinatorlayout> 

ouput:

here app bar looking when scrolled app bar scrolled up.please click here see

here mainactivity code above. apart shown in above picture,the appbarlayout not scrolled when list items in viewpager scrolled.

you need add android:fitssystemwindows="true" , remove paddingtop appbarlayout:

<android.support.design.widget.appbarlayout     android:id="@+id/appbar"     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:fitssystemwindows="true"     android:theme="@style/apptheme.appbaroverlay">  <android.support.v7.widget.toolbar     android:id="@+id/toolbar"     android:layout_width="match_parent"     android:layout_height="?attr/actionbarsize"     android:background="?attr/colorprimary"     app:layout_scrollflags="scroll|enteralways"     app:popuptheme="@style/apptheme.popupoverlay"/>  <android.support.design.widget.tablayout     android:id="@+id/tabs"     android:layout_width="match_parent"     android:layout_height="wrap_content"/>  </android.support.design.widget.appbarlayout> 

Comments

Popular posts from this blog

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

jsf - "PropertyNotWritableException: Illegal Syntax for Set Operation" error when setting value in bean -

arrays - Algorithm to find ideal starting spot in a circle -