gpt4 book ai didi

java - 使带下划线的文本拉伸(stretch) 100%

转载 作者:行者123 更新时间:2023-12-02 03:17:27 25 4
gpt4 key购买 nike

我使用以下内容在屏幕上显示文本:

<TextView
android:text="@string/today_label"
android:layout_width="match_parent"
android:textSize="20dp"
android:textStyle="italic"
android:layout_height="wrap_content"
android:layout_below="@+id/textView3"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginTop="27dp"
android:id="@+id/textView4" />

// XML
<string name="today_label"><u>Today</u></string>

实际结果

Actual

预期结果

Expected

最佳答案

我会为此添加一个View:

<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#cccccc" />

例如线性布局。像这里一样:Android underline whole textView

如果您像这样在文本下划线:

<string name="today_label"><u>Today</u></string>

您将始终只在文本下划线。

关于java - 使带下划线的文本拉伸(stretch) 100%,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40083213/

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