Reputation: 391
I just noticed that the borders of the Button and the ImageButton look different. The ImageButton is totally flat. I cannot explain it and I would like to have the ImageButton as "3d-ish" as the default Button. Any ideas are welcome!
This is my xml-code
<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>
And this is how it looks on my Lollipop tablet:
Thanks in advance! Thomas
Upvotes: 2
Views: 562
Reputation: 24124
Button
has default elevation (actually, it has a StateListAnimator
that provides elevation when the button is enabled) under the Material theme, whereas ImageButton
does not.
Upvotes: 3