android - 如何忽略“文本大小太小”
问题描述
如何忽略 Android Studio 中的“文本大小太小”警告?
例如,在我的一个 TextViews 中:
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="3"
android:singleLine="false"
android:text="@string/navtask_btn_arrived"
android:textAlignment="center"
android:textSize="8sp"
tools:ignore="textSize"/>
我试图添加:
tools:ignore="textSize"
tools:ignore="TextSize"
tools:ignore="SpUsage"
tools:ignore="spUsage"
tools:ignore="dimen"
它应该与“textSize”一起使用,因为文档中提到它可以与任何属性一起使用。
我知道其中一些没有任何意义,但是,嘿,为什么不在这里问之前尝试一下呢?
有任何想法吗?
解决方案
您需要添加属性tools:ignore="SmallSp"
以删除警告使用SmallSp
,其中SmallSp
表示小的可缩放像素为
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="3"
android:singleLine="false"
android:text="@string/navtask_btn_arrived"
android:textAlignment="center"
android:textSize="8sp"
tools:ignore="SmallSp"/>
推荐阅读
- html - boostrap 下拉菜单对齐
- c# - ItemsControl / TextBox 性能下降
- c# - Webclient + UploadStringAsync + 事件:UploadProgressChanged / DownloadProgressChanged
- c - 链表中的多次出现删除功能只删除字符的第一个实例
- python - 如何在条形图中标记分类变量?
- python - 如何使用变量作为其他文件中的名称来调用函数
- javascript - GitHub Pages + Jekyll + Bootstrap + CDN 问题
- java - 有没有一种方法可以在不创建另一个数组的情况下排除数组中的非重复数字?
- drop-down-menu - 无法让动态下拉列表在 Kendo 网格行中工作
- r - 尝试在 R 中运行 kNN 时收到 coercionNAs 引入的错误 NA?