gpt4 book ai didi

带左右边距的 Android 按钮

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:13:49 25 4
gpt4 key购买 nike

我有以下布局

<?xml version="1.0" encoding="utf-8"?>

<Button
android:id="@+id/sign_in"
style="@style/ButtonText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/custom_button_green"
android:text="@string/signin_via_email"
android:textSize="15sp"
android:typeface="sans" />

现在我真的不想让按钮适合整个宽度,而是我想要左边 10dp 的边距和右边 10dp 的边距。我已经设置了 padding 和 layout_marginLeft 和 right 属性,但它们不起作用。有什么帮助吗?

亲切的问候

最佳答案

 <Button
style="@style/ButtonText"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:id="@+id/btnOk"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="OK" />

关于带左右边距的 Android 按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12405348/

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