简体   繁体   中英

How to create shadow on left and right side view?

I want to create shadow(elevation) to a view. I have seen the same kind of question is asked here but it has no accepted answer yet.

Android how to create gradient shadow on left and right of view?

Now I make it alive.

Try this with Cardview

<android.support.v7.widget.CardView
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:cardUseCompatPadding="true"
    app:cardElevation="4dp"
    app:cardCornerRadius="3dp" >

    <!-- put your attributes -->

</android.support.v7.widget.CardView>

http://www.zoftino.com/android-view-shadow-effect

OR

You can use 9-patch image.

http://inloop.github.io/shadow4android/

I would highly recommend looking into CardView .

Your desired functionality is built-in.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM