Reputation: 51
I am developing an app for Card View.Implement two features of card view "setRadius()" and "setElevation()" .It is working fine in Android L.
But when I run the app in API 19 (KitKat) , card view setElevation() getting an error
java.lang.NoSuchMethodError: android.view.View.setElevation"
Can any one please help me to make this app compatible to all version.
Upvotes: 0
Views: 674
Reputation: 3665
possible duplicated. Android AppCompat 21 Elevation
Basically setElevation from ViewCompat won't even work.
Upvotes: 1
Reputation: 11038
Take a look at the docs for setElevation and you can see that it was added in API 21 (which is Lollipop).
You can, however, use the ViewCompat library's version of setElevation, and then it should work on lower API levels.
Upvotes: 0