我刚刚更新了我的SDK,现在eclipse在我的xml中给了我各种完全不需要的警告...例如我有一个没有id或背景的RelativeLayout(它实际上是一个透明按钮)和日食警告我,这是一个无用的元素.有没有办法把这个白痴关掉?
TIA
小智 13
根据http://tools.android.com/recent/ignoringlintwarnings上的文档,您可以通过包含xmlns工具来完成此操作:
xmlns:tools="http://schemas.android.com/tools"
Run Code Online (Sandbox Code Playgroud)
然后添加工具:忽略相关元素中的注释:
<RelativeLayout
tools:ignore="UselessParent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="30dp"
android:layout_centerInParent="true">
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
10908 次 |
| 最近记录: |