2012-11-04 45 views
-1

在Android中,使用XML时,如何关闭注释?Android:评论未关闭 - >

这一块我的代码:

<Button 
    android:id="@+id/25" 
    android:layout_width="fill_parent" 
    <!-- Last Button in the Row occupying all the remaining Space --> 
    android:layout_height="wrap_content" 
    android:layout_below="@id/five" 
    android:layout_toRightOf="@id/20" 
    android:text="25" 
    android:textSize="20dp" /> 

显然,我已经和关闭了评论 - >这是我所学到和看到网上资源。

但是,Eclipse并没有将其视为已关闭的评论,所有评论之后的文本也被视为评论。

我该如何解决这个问题?

回答

-1

保持你的标签外的评论。

事情是这样的:

<!-- Last Button occupying the whole space --> 
<Button ... /> 
2

您不能将注释放入xml标签中。

你必须移动您的评论标签之外,像这样:

<!-- My Comment --> 
<Button ... /> 
0

不能其间的一个标记注释,上面送花儿给人评论是这样的:

<!-- Last Button in the Row occupying all the remaining Space --> 
<Button 
    android:id="@+id/25" 
    android:layout_width="fill_parent" 

    android:layout_height="wrap_content" 
    android:layout_below="@id/five" 
    android:layout_toRightOf="@id/20" 
    android:text="25" 
    android:textSize="20dp" />