首页 > 解决方案 > android中字符串中的底层文本

问题描述

这是我的 string.xml

<string name="terms_condition"> Accept the <u>Terms &amp; Conditions</u></string>

这是我的文本视图

<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">


    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/terms_condition"
        android:padding="25dp"
        />



</android.support.constraint.ConstraintLayout>

我正在使用此代码显示下划线文本,但两个字符串之间没有空格。如何保持两个文本之间的空间以及如何减少下划线?在下面的屏幕中,您可以看到下划线问题。

在此处输入图像描述

标签: android

解决方案


<string name="terms_condition"> Accept the\n<u>Terms &amp; Conditions</u></string>. 我认为这应该有效。


推荐阅读