Is there a way to disable the xml warnings?

后端 未结 2 2043
离开以前
离开以前 2021-02-13 18:10

I just did an update of my SDK and now eclipse is giving me all sorts of totally unwanted warnings in my xml... for example I have a RelativeLayout that doesn\'t have an id or a

相关标签:
2条回答
  • 2021-02-13 18:14

    In New Update of Eclipse ADT Plugins will give you New Tool Which Name is Lint here is one SO Link for this tool and it's advantages .Click Here

    Now for Disable xml Warnings that are come from Lint Android Tool ,you need to go

    Window-->Preferences-->Android-->Lint Error Checking

    in this Dialog you will find all Issue for Xml in android and you can make disable it ,if you want to disable.And Make sure you will not disable usefull lint warning because it's help us to find there are multiple ID assign in xml and lot more..

    0 讨论(0)
  • 2021-02-13 18:29

    According to the documentation at http://tools.android.com/recent/ignoringlintwarnings you do this by including the tools xmlns:

    xmlns:tools="http://schemas.android.com/tools"
    

    And then adding a tools:ignore annotation in the relevant elements:

    <RelativeLayout
        tools:ignore="UselessParent"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_margin="30dp"
        android:layout_centerInParent="true">
    
    0 讨论(0)
提交回复
热议问题