Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fragment中失效 #1

Open
AndyGu opened this issue Mar 7, 2017 · 14 comments
Open

Fragment中失效 #1

AndyGu opened this issue Mar 7, 2017 · 14 comments

Comments

@AndyGu
Copy link

AndyGu commented Mar 7, 2017

在fragment中的RecyclerView,sticky header失效 并不能悬停

@oubowu
Copy link
Owner

oubowu commented Mar 9, 2017

莫非你的sticky header是放在activity的布局上的?而不是在fragment的布局上

@BlackHumorwj
Copy link

Fragment中无效,刷新了之后可以悬停,不刷新悬停失效

@xiang23
Copy link

xiang23 commented Jun 23, 2017

有什么解决的方法吗?

@oubowu
Copy link
Owner

oubowu commented Jul 27, 2017

能给个demo吗 这样说我不知道咋整

@zofnk
Copy link

zofnk commented Sep 28, 2017

@oubowu 就是在Fragment中的RecyclerView设置sticky header,并没有效果

@oubowu
Copy link
Owner

oubowu commented Oct 16, 2017

我这边试了下 并没有问题 , 这是我fragment加载的布局的xml , 你看下是不是把StickyHeadContainer的layout_width设成0dp了
`

<android.support.v7.widget.RecyclerView
    android:id="@+id/recycler_view"
    android:layout_width="368dp"
    android:layout_height="495dp"
    android:layout_alignParentTop="true"
    android:layout_margin="10dp"
    tools:background="@color/colorAccent"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    tools:layout_editor_absoluteY="8dp"
    tools:layout_editor_absoluteX="8dp">

</android.support.v7.widget.RecyclerView>

<com.oubowu.stickyitemdecoration.StickyHeadContainer
    android:id="@+id/shc"
    android:layout_width="match_parent"
    android:layout_margin="10dp"
    android:layout_height="wrap_content"
    tools:layout_editor_absoluteY="0dp"
    tools:layout_editor_absoluteX="16dp">

    <include
        layout="@layout/item_stock_sticky_head"/>

</com.oubowu.stickyitemdecoration.StickyHeadContainer>

`

@KeqingLI
Copy link

@BlackHumorwj 我也遇上相同的问题 找到原因了么

@oubowu
Copy link
Owner

oubowu commented Nov 20, 2017

@KeqingLI 你能弄个demo我看看嘛

@KeqingLI
Copy link

KeqingLI commented Nov 23, 2017

demo复现失败后发现是 sticky栏的布局问题
失败的
`

<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tool="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
     >
    <TextView
        android:id="@+id/tv_date"
        style="@style/tv_black12"
        android:layout_width="match_parent"
        android:layout_gravity="center"
        android:gravity="center"
        android:paddingBottom="8dp"
       android:paddingTop="8dp"
     tool:text="已结束"
    />
</FrameLayout>

`

成功的
`

<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tool="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingBottom="8dp"
    android:paddingTop="8dp"
   >
    <TextView
        android:id="@+id/tv_date"
        style="@style/tv_black12"
        android:layout_gravity="center"
        android:gravity="center"
        tool:text="已结束"
        />
</FrameLayout>

`

@WaoSan
Copy link

WaoSan commented Nov 28, 2017

        <android.support.v7.widget.RecyclerView
            android:id="@+id/phone_info_content_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@color/white" />
        <com.oubowu.stickyitemdecoration.StickyHeadContainer
            android:id="@+id/shc"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <include layout="@layout/item_stock_sticky_head" />

        </com.oubowu.stickyitemdecoration.StickyHeadContainer>

    </RelativeLayout>

sticky header有些时候显示,有些时候不显示,不显示的居多

@oubowu
Copy link
Owner

oubowu commented Nov 28, 2017

我有时间看下怎么处理吧 可能是测量出问题了

@aBenVip
Copy link
Contributor

aBenVip commented Jul 13, 2018

我也复现了此问题,请问作者解决了该问题吗?

@ayuhani
Copy link

ayuhani commented Jul 22, 2019

在fragment中同样不显示,希望作者解决

@oubowu
Copy link
Owner

oubowu commented Jul 23, 2019

能不能把问题描述清楚 我这边测了没问题 一句话我怎么去重现 @ayuhani 能不能给个项目例子我

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants