gpt4 book ai didi

android - 如何创建android按钮栏?

转载 作者:行者123 更新时间:2023-12-02 15:09:47 24 4
gpt4 key购买 nike

我需要创建一个水平按钮列表,没有像这样的分隔空间 enter image description here buttonbar
每个按钮将包含一个文本和一个图标,我知道有关按钮栏布局的信息,但它对我不起作用,请有人帮助我,提前致谢

最佳答案

<LinearLayout 
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawableTop="@drawable/read"
android:text="Rewards" />

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawableTop="@drawable/read"
android:text="Places" />

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawableTop="@drawable/read"
android:text="Challenges" />
</LinearLayout>

使用水平方向的LinearLayout和layout_weight=1的三个按钮

关于android - 如何创建android按钮栏?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43136502/

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