How to show shadow around the linearlayout in Android?

前端 未结 13 2567
名媛妹妹
名媛妹妹 2020-11-27 10:51

How can I show shadow for my linear layout. I want white colored rounded background with shadow around the linearlayout. I have done this so far.



        
13条回答
  •  心在旅途
    2020-11-27 11:19

    There is no such attribute in Android, to show a shadow. But possible ways to do it are:

    1. Add a plain LinearLayout with grey color, over which add your actual layout, with margin at bottom and right equal to 1 or 2 dp

    2. Have a 9-patch image with a shadow and set it as the background to your Linear layout

提交回复
热议问题