Android Studio报错: This item may not have a label readable by screen readers
报错信息:
Solution:
java
//1. 在LinearLayout 中添加代码
xmlns:tools="http://schemas.android.com/tools"
//2. 在Button中添加代码
tools:ignore="TouchTargetSizeCheck,SpeakableTextPresentCheck"
xml-dtd
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#EEEEEE"
android:orientation="vertical"
android:padding="5dp"
tools:context=".CalculatorActivity">
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background"
tools:ignore="TouchTargetSizeCheck,SpeakableTextPresentCheck">
</Button>
如果对你有帮助,就一键三连呗(点赞+收藏+关注),我会持续更新更多干货~~