android - android中字符串中的底层文本
问题描述
这是我的 string.xml
<string name="terms_condition"> Accept the <u>Terms & 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>
我正在使用此代码显示下划线文本,但两个字符串之间没有空格。如何保持两个文本之间的空间以及如何减少下划线?在下面的屏幕中,您可以看到下划线问题。
解决方案
<string name="terms_condition"> Accept the\n<u>Terms & Conditions</u></string>
. 我认为这应该有效。
推荐阅读
- python - 如何让 ipywidgets 交互以在 HTML 中工作?
- python - Python:Nessus API 未下载报告
- java - 如何让我的程序“记住”我点击的内容?//已编辑
- solidity - MetaMask - RPC 错误:错误:[ethjs-rpc] rpc 错误,有效负载 {"id":6553471421858,"jsonrpc":"2.0","params":
- c# - 所以在 c# 中 int 没有同步块索引,也没有对类型对象的引用。CLR 如何知道要启动什么 ToString() 方法?
- javascript - 为什么在使用 Node.js 运行文件时显示此错误?
- android - 用 koin 检索片段
- fish - 有没有办法在打字时忽略/取消特定的鱼壳完成?
- php - php 函数给出一个循环 - hostfact API
- java - Gmail API:找不到请求目标的有效证书路径