2012-05-31 23 views

回答

3

XML中的註釋是這樣的

<!-- this is a comment --> 

注意,他們可以跨越多條線路上

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

但他們不能嵌套

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

你也可以不使用它們裏面的標籤

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

+1偉大的答案。 –

+0

我試過,但後來它就像隱藏它從android:id一路下來我只想使用android:textSize行上的代碼:ID = 「@ + ID/tvResults」 機器人:比重= 「中心」 機器人:layout_width = 「FILL_PARENT」 機器人:layout_height = 「WRAP_CONTENT」 \t \t/> – Fernando

+0

@FernandoRamirez答案指出,你不能在標籤內使用它們。 –

0

評論中HTML & XML是像這樣:

<!-- this is a comment --> 

詳情請參閱On SGML and HTML: Comments


建議:

<!-- 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" /> 
相關問題