Elevation not working on a LinearLayout

前端 未结 7 1270
小蘑菇
小蘑菇 2020-12-24 01:25

After searching for a solution, I didn\'t find any to solve my problem.

I have some elevation which produces a shadow on a big part of my app.
But in a particula

相关标签:
7条回答
  • 2020-12-24 01:51

    This is a drawing issue.

    The cast shadow is drawn outside of the actual views bounds, so if the Parent layout does not "give" the view enough space, it will be clipped.

    Since the parent of the fragment (Linear layout) has the same size, the shadow is clipped. Add a margin on the bottom to the LinearLayout.
    If this does not help try wrapping the layout with a FrameLayout with a little margin on the bottom (Do NOT use a padding. A padding on the framelayout will also cut the shadow off)

    1-2dp should do.

    0 讨论(0)
提交回复
热议问题