【发布时间】:2014-08-20 10:34:50
【问题描述】:
我需要设计一个这种类型的按钮,它应该有一个背景,中间是另一个小图像,底部是文本。
虽然我当前使用的是如下文本视图
<TextView
android:id="@+id/homeButton1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="5dp"
android:layout_weight="1"
android:background="#ffffff"
android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false"
android:gravity="center"
android:text="Button"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@drawable/button_color"
android:textStyle="bold" />
但是我不能把图像放在它的中心。
如果我使用 android:drawableTop 这是我得到的图像
这怎么可能?
【问题讨论】:
-
使用imagebutton和textview对齐bottem到imagebutton
-
你可以使用复合drawables
-
在下面查看我的答案。
标签: android xml button textview