The Layout coordinator makes the anchored item disappear when scrolling up

I have a really uncomfortable problem that I cannot get rid of and that I absolutely do not understand.

I just want my app bar to crash and the image to move with some placeholder in the app bar area. I got this from this example: https://github.com/saulmm/CoordinatorBehaviorExample

I use a very simple layout:

<CoordinatorLayout>

    <AppBarLayout>
        <CollapsingToolbarLayout
            android:minHeight="96dp"
            app:layout_scrollFlags="exitUntilCollapsed|scroll">
            <FrameLayout android:id="@+id/anchorPlaceHolder .../>
        </CollapsingToolbarLayout>
    </AppBarLayout>

    <NestedScrollView ...>

    <ImageView
        app:layout_anchor="@id/anchorPlaceHolder
        ...
        />

</CoordinatorLayout>

Everything works as expected - EXCEPT one massive error. When the scroll reaches its upper end - otherwise the toolbar reaches its minimum height - my image just disappears. It is "off" - and I do not know why and who does it.

enter image description here

, "", - . enter image description here

- , ?

0
1

, .

AppBarLayout, CollapsingToolbarLayout , , , .

: " , . ( ), .

, , , CollapsingToolbarLayout, , CoordinatorLayout, , . , - , .

: .: -)

: AppBarLayout 0dp.

, , : CollapsingToolbarLayout ...; -)

+4

All Articles