i have viewpager in coordinatorlayout this:
<android.support.design.widget.appbarlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/themeoverlay.appcompat.dark.actionbar"> <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"/> <android.support.design.widget.tablayout android:id="@+id/tab_layout" android:layout_width="match_parent" android:layout_height="wrap_content" app:tabmode="scrollable"/> </android.support.design.widget.appbarlayout> <android.support.v4.view.viewpager xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/pager" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior" /> and in viewpager, each fragment webview.
the code can run when scroll webview. tablayout offscreen not working. @ header.
update:
i try use relativelayout content views , use nestedscrollview relativelayout's parent webview disappeared(progressbar showed fine). bug???
here fragment layout:
<android.support.v4.widget.nestedscrollview xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/nestedscrollview" android:layout_width="match_parent" android:layout_height="match_parent"> <relativelayout android:layout_width="match_parent" android:layout_height="match_parent" android:minheight="300dp"> <progressbar android:id="@+id/pb" style="?android:attr/progressbarstylehorizontal" android:layout_width="fill_parent" android:layout_height="2dp" android:indeterminateonly="false" android:max="100" android:progressdrawable="@drawable/progress_bar_states"></progressbar> <com.handmark.pulltorefresh.library.pulltorefreshwebview android:id="@+id/webview" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@id/pb" /> </relativelayout> </android.support.v4.widget.nestedscrollview>
for having issue content not showing when using nestedscrollview,add "fillviewport" xml:
<android.support.v4.widget.nestedscrollview xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/nestedscrollview" android:layout_width="match_parent" android:layout_height="match_parent" android:fillviewport="true">
Comments
Post a Comment