I have a ImageView that I want to add a shadow to it, but with a large radius area.!
I tried using elevation
but it doesn't seem to increase the radius very much..!
I also tired using xml drawable shape but with no luck. Here's an example of what I want to achieve. assuming the white circle is the image.
中剥离文字答案 0 :(得分:1)
I tried using elevation but it doesn't seem to increase the radius very much..!
我认为 ImageView 没有实现elevation
属性,你可以只写属性,因为 ImageView 是来自 View的子类 class。
如果您需要实现该高程并获得阴影,请使用FloatingActionButton
进行操作,或者如果您不需要使用FloatingActionButton
并继续使用ImageView,则必须设置CardView
1}}作为ImageView
的容器,并将高程添加到CardView
。
答案 1 :(得分:0)
我会通过使用CardView
(在Lollipop或更高版本上来解决这个问题;前Lollipop,这不会起作用):
<android.support.v7.widget.CardView
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center"
app:cardElevation="20dp"
app:cardCornerRadius="24dp">
<ImageView
android:layout_width="48dp"
android:layout_height="48dp"
android:padding="12dp"
app:srcCompat="@drawable/ic_arrow_back_24dp"/>
</android.support.v7.widget.CardView>