Android的图像按钮 [英] android image button
本文介绍了Android的图像按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我怎样才能创建一个没有文字和水平居中图像的按钮? 我不希望使用的ImageButton,因为我想定义一个不同的backgound图像
How can i create a button with no text and an image centered horizontally ? I don't want to use an ImageButton because I want to define a different backgound image
推荐答案
您只需使用一个ImageButton的,使任何你想要的背景和设置图标为SRC。
You just use an ImageButton and make the background whatever you want and set the icon as the src.
<ImageButton
android:id="@+id/ImageButton01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/album_icon"
android:background="@drawable/round_button" />
这篇关于Android的图像按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文