Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to disable the xml warnings?

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 background (it's actually a transparent button) and eclipse is warning me that it's a useless element. Is there a way to turn this idiocy off?

TIA

like image 343
Yevgeny Simkin Avatar asked Apr 06 '12 04:04

Yevgeny Simkin


1 Answers

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">
like image 82
alphonzo79 Avatar answered Oct 15 '22 00:10

alphonzo79