Android 安卓-向上滚动时,在顶部的一个片段插针中显示TabLayout

Android 安卓-向上滚动时,在顶部的一个片段插针中显示TabLayout,android,android-layout,android-tablayout,Android,Android Layout,Android Tablayout,我尝试了组合使用AppBarLayout和collazingtoolbarlayout,但在这种情况下不起作用。似乎它只适用于主活动布局。当涉及到片段C中的选项卡布局时,向上滚动时是否可以锁定选项卡布局?谢谢你的帮助 这是一个由片段a、片段B、片段C组成的片段,片段C包含一个视图分页器和选项卡布局 最后,我想在向上滚动时将选项卡布局固定在屏幕顶部 您可以使用StickyScrollView 不要忘了在你的布局中提供你想要固定的标签属性,你可以根据你的要求通过上面提到的链接获得更多标签。你可

我尝试了组合使用
AppBarLayout
collazingtoolbarlayout
,但在这种情况下不起作用。似乎它只适用于主活动布局。当涉及到片段C中的选项卡布局时,向上滚动时是否可以锁定选项卡布局?谢谢你的帮助

这是一个由片段a、片段B、片段C组成的片段,片段C包含一个视图分页器和选项卡布局

最后,我想在向上滚动时将选项卡布局固定在屏幕顶部


您可以使用StickyScrollView



不要忘了在你的布局中提供你想要固定的
标签
属性,你可以根据你的要求通过上面提到的链接获得更多标签。

你可以使用StickyScrollView


别忘了在你的布局中给出你想要固定的
标签
属性,你可以根据你的要求通过上面提到的链接获得更多的标签

<com.kiwkard.views.StickyScrollView
    android:id="@+id/sticky_scroll"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fillViewport="true">

    <LinearLayout 
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:background="@color/white"
          android:orientation="vertical"
android:tag="sticky-nonconstant">


<android.support.design.widget.TabLayout
    android:id="@+id/tab_Layout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/colorPrimary"
    android:minHeight="?attr/actionBarSize"
    app:tabGravity="fill"
    app:tabIndicatorHeight="3dp"
    app:tabMode="fixed"
    app:tabSelectedTextColor="@color/white"
    app:tabTextAppearance="@android:style/TextAppearance.Widget.TabWidget"
    app:tabTextColor="@color/black_30"/>

<android.support.v4.view.ViewPager
    android:id="@+id/pager_event"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

</android.support.v4.view.ViewPager>

</com.kiwkard.views.StickyScrollView>