I am targeting api 17, and I would like to have shadows on devices that support material design. Is there something like "If shadows supported, use shadows"?
Asked
Active
Viewed 25 times
-1
-
You mean your `targetSdkVersion` is 17? or `minSdkVersion` is 17? – Varad Mondkar Jul 13 '18 at 09:16
-
Oh sorry, I meant minSdkVersion. – Etwus Jul 13 '18 at 09:19
-
Possible duplicate of [No shadow by default on Toolbar?](https://stackoverflow.com/questions/26575197/no-shadow-by-default-on-toolbar) – Manohar Jul 13 '18 at 09:23
-
https://stackoverflow.com/questions/31115531/add-elevation-shadow-on-toolbar-for-pre-lollipop-devices/32393698 – Manohar Jul 13 '18 at 09:24
-
1Adding `android:elevation="
"` this attribute to your toolbar gives you shadow. Still if you thing no stackoverflow question are helping you, then please post your code for further assistance. – Varad Mondkar Jul 13 '18 at 09:26
1 Answers
0
Adding android:elevation did solve it.
I thought that this attribute will crash on pre-lollipop devices, as it is not shown in layout editor when minSDK is set to less than 21.

Etwus
- 549
- 5
- 15