0

Currently I have the following layout in my Activity:

<CoordinatorLayout> <AppBarLayout> <Toolbar layout_scrollFlags="scroll|enterAlways|snap"> <NestedScrollView> layout_behavior="@string/appbar_scrolling_view_behavior"> <RelativeLayout> <ProgressBar/> <FrameLayout id=fragment-container> 

and this for my Fragment:

<LinearLayout> <CardView layout_scrollFlags="scroll|enterAlways|snap"> <RecyclerView> 

When scrolling my recyclerView, the toolbar moves following the scroll flags defined in the xml, but the cardview doesn't. How to implement the same behavior to the cardview?

2
  • I think your answer might be found here, if you want to scroll inside the Cardview. Resume of linked post : Although google emphatically recommends avoiding making a card scrollable because it could cause two sets of scroll bars to be displayed (see this page ) A solution would be to wrap the contents of your card with a ScrollView. See this page for reference. Commented Nov 27, 2017 at 13:12
  • it's not scroll inside the CardView, what i'm looking for is when the recycler view below is scrolled, the Card above behave like an toolbar, hiding, until the event of scroll on the opposite direction happen. Commented Nov 28, 2017 at 10:26

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.