gpt4 book ai didi

java - 在Android中的按钮内左对齐文本

转载 作者:IT老高 更新时间:2023-10-28 13:25:36 33 4
gpt4 key购买 nike

我想将按钮的文本向左对齐,我不知道该怎么做,请帮助我如何在 xml 文件中做到这一点。我没有找到这个的属性。

最佳答案

也许这会对你有所帮助:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<Button
android:id="@+id/button1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="left|center_vertical"
android:text="Button" />

</LinearLayout>

关于java - 在Android中的按钮内左对齐文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11337513/

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