Giter Club home page Giter Club logo

Comments (4)

PACordonnier avatar PACordonnier commented on July 28, 2024 3

Okay so I used a workaround in order to make it work properly.

I encapsulate my CardView inside a simple LinearLayout

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:card_view="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <android.support.v7.widget.CardView
        android:id="@+id/card_view"
        android:layout_width="match_parent"
        android:layout_height="300dp"
        android:layout_marginBottom="@dimen/vertical_margin_half"
        android:layout_marginLeft="@dimen/vertical_margin"
        android:layout_marginRight="@dimen/vertical_margin"
        android:layout_marginTop="@dimen/vertical_margin_half"
        card_view:cardCornerRadius="2dp">

I'm not closing the issue but I hope this helps ;)
Thanks for the library !

from stickyheaders.

ShamylZakariya avatar ShamylZakariya commented on July 28, 2024

Interesting. I have to assume this is something to do with CardView -- StickyHeaderLayoutManager simply asks for how tall the item wants to be when laid out, it doesn't do anything special. Glad you were able to find a workaround, but let's leave this open so I can think about this.

from stickyheaders.

robotsquidward avatar robotsquidward commented on July 28, 2024

Seconding this, using CardView as a header locked all the views into the same height, even after changing visibility to GONE or doing wrap_content on the height.

I wrapped my CardView in a FrameLayout and it's working like a charm.

from stickyheaders.

benyAlves avatar benyAlves commented on July 28, 2024

Hi I am facing the same issue, is there an official solution? This Issue is opened since 2016

from stickyheaders.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.