在SDK Manager的Android 5.0示例中,有ElevationBasic示例.它显示了两个View对象:圆形和方形.圆圈android:elevation设置为30dp:
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2014 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF …Run Code Online (Sandbox Code Playgroud) 下午好,我正在尝试使用阴影创建带有ImageButton的图像.
要做到这一点 :
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:padding="5sp">
<ImageButton
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/circle_shape_little"
android:src="@drawable/ic_keyboard_arrow_right_black_24dp"
android:elevation="3sp"/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
但结果如下:
如你所见,边界是"切",我不知道为什么.
有人能帮帮我吗?谢谢.