fornewid / neumorphism

Try to Neumorphism in Android (Just experimental!! 🧪)
https://medium.com/@fornewid/neumorphism-in-android-9cf15e2122dc
Apache License 2.0
980 stars 160 forks source link

Set gradient background to NeumorphCardView #16

Closed rashmitank27 closed 4 years ago

rashmitank27 commented 4 years ago

I am not able to set gradient background to NeumorphCardView. Please give me example on how to do it.

fornewid commented 4 years ago

This library uses android:background to draw neumorphism decoration. So you can't use android:background attributes for Neumoprh widgets. (Not working)

Instead you can get it by adding a view that draws the background. See the following code:

<soup.neumorphism.NeumorphCardView>
    <View
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/gradation" />
</soup.neumorphism.NeumorphCardView>
fornewid commented 4 years ago

If it still reproduces, please reopen.

fluttyCat commented 3 years ago

i can not add gradiant background to neu button too. what should i do?