How to add shadow to linear layout - android?

前端 未结 6 1638
伪装坚强ぢ
伪装坚强ぢ 2020-12-18 05:41

In my android application I have to implement something like the image given below :

I have tried using shadow xmls for a linear layout but it doesn\'t seem to wor

6条回答
  •  执念已碎
    2020-12-18 06:17

    I might be late to this but in case someone else is needs it. You can use this tool http://inloop.github.io/shadow4android/ It allows you to make an image with shadow but treated not as a normal image but as a special one. You will get an image ending with .9.png instead of .png You should keep that .9 as it will direct Android Studio to treat as 9 patch

    Then add this image to your drawables folder. Use it as a background for your Layout & you will get a nice natural shadow effect that until now I've never seen any drawable able to do the same

提交回复
热议问题