gpt4 book ai didi

android - 如何对齐按钮的用户界面?

转载 作者:行者123 更新时间:2023-11-29 16:14:38 26 4
gpt4 key购买 nike

我需要对齐我发布的按钮的 UI。我不确定如何使用 ButtonImageButton。如何对齐按钮中的图像和文本?

<ImageButton
android:id="@+id/btnGroupDelete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dip"
android:layout_weight="1"
android:background="@drawable/list_buttonselector"
android:contentDescription="@string/delete"
android:src="@drawable/ox_icn_delete" />

最佳答案

将图像保存在drawable中,然后在xml中使用图像按钮

<ImageButton
android:id="@+id/ImageButton01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/button_image_name" />

对于按钮的状态变化(按下,聚焦,默认),看看

http://developer.android.com/reference/android/widget/ImageButton.html

关于android - 如何对齐按钮的用户界面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10459778/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com