2

I am getting an issue on android lollipop. I have a FrameLayout, in that layout I have a Cardview and at the top I have a RecyclerView. like

<framelayout>
   <cardview/>
   <recylerview/>
</framelayout>

whenever I set cardElevtion everything works fine in prelollipop devices. I can see recyclerview items clearly and can scroll them, but in lollipop I am facing an issue that is items can scroll but they scrolls at the backside of cardView. CardView appears as floating. I am unable to figure out what is the importance criteria for different layouts in android lollipop release.

here are the screenshots. with 0 cardElevetaion. enter image description here

with n cardElevetion. enter image description here

Muhammad Adil
  • 4,358
  • 3
  • 32
  • 36

1 Answers1

0

I could not get any proper solution to this but all I figured out that after release of lollipop version, Android always give priority to components having greater elevation. This is why cardview with n elevation is being shown top of its own child (recyclerview).

here is a possible solution

You can also give some elevation to the children components, which should be greater or equal to elevation of cardview (or parent component)

Muhammad Adil
  • 4,358
  • 3
  • 32
  • 36