Android 按钮和ImageButton的外观差异

Android 按钮和ImageButton的外观差异,android,button,android-5.0-lollipop,imagebutton,Android,Button,Android 5.0 Lollipop,Imagebutton,我只是注意到按钮和ImageButton的边框看起来不同。ImageButton是完全扁平的。我无法解释它,我想让ImageButton作为“3d ish”作为默认按钮。欢迎任何意见 这是我的xml代码 <LinearLayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:gra

我只是注意到按钮和ImageButton的边框看起来不同。ImageButton是完全扁平的。我无法解释它,我想让ImageButton作为“3d ish”作为默认按钮。欢迎任何意见

这是我的xml代码

<LinearLayout
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center">

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Power"
        android:id="@+id/button1"
        android:layout_gravity="center"
        android:layout_weight="0"
        android:layout_centerInParent="true" />

    <ImageButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/f_light_on"
        android:id="@+id/button4"
        android:layout_gravity="center"
        android:layout_weight="0"
        android:layout_centerInParent="true" />
</LinearLayout>

这就是我的棒棒糖平板电脑的外观:

提前谢谢!
Thomas

按钮
在材质主题下有默认的标高(实际上,它有一个在按钮启用时提供标高的图标),而
ImageButton
则不然。

您想要带边框的ImageButton吗?您是否尝试过添加
style:android:attr/buttonStyle
最好在drawable文件夹中创建一个样式,并设置android:background=“@drawable/your_xml”以保持其一致性您可以使用“3d-ish”自由设计自己的9补丁程序听着,谢谢你的否决票:(在我看来,这是一种非常不一致的行为。我在问自己,为什么两个按钮的唯一区别是一个包含文本,另一个包含图像。谢谢!这澄清了这种行为,尽管它看起来并不一致。
ImageButton
通常与空背景一起使用,而空背景不适合设置。)在设计材质小部件样式时,我们选择了尽可能少地中断应用程序。