【发布时间】:2017-02-14 06:18:06
【问题描述】:
在android中的image view后面添加阴影
这是 android 中带有默认阴影的示例图像:
和xml:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.home.fmat.MainActivity">
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/on"
android:src="@drawable/Google_Duo"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"/>
</RelativeLayout>
【问题讨论】:
-
显示 xml 布局
-
你可以设置空背景,但我认为
android:background="?android:attr/selectableItemBackground"更正确 -
那个问题没有问到改变背景颜色
标签: android