Question

So I want to tell myself some things withing the .xml file using Pseudo code but when I do the // it enters it like a code so I can't really use it in there. Is there something I could do to make the code non readable like Pseudo Code? I'm doing this in an android application. Under the res/layout/(.xml file) folder. Thanks!

Was it helpful?

Solution

The comment in XML are like this

<!-- this is a comment -->

Notice that they can span on multiple lines

<!--
    This is a comment
    on multiple lines
-->

But they cannot be nested

<!-- This <!-- is a comment --> This is not -->

Also you cannot use them inside tags

<EditText <!--This is not valid--> android:layout_width="fill_parent" />

OTHER TIPS

Comments in HTML & XML are like so:

<!-- this is a comment -->

See On SGML and HTML: Comments for more details.


Suggestion:

<!-- textSize: For the 'hearing impaired'. --> 
<TextView 
    android:text="invalid" 
    android:textSize="25dp" 
    android:id="@+id/tvResults" 
    android:gravity="center" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" /> 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top