我的 AndroidManifest.xml
文件中有以下代码,我想在其中注释掉一行(用于快速测试)。通过选择 AndroidStudio
-comment 函数,我得到以下内容:
<application
android:allowBackup="true"
android:icon="@mipmap/myicon"
android:label="@string/app_name"
android:supportsRtl="true"
<!--android:theme="@style/AppTheme"-->
android:theme="@style/ThemeOverlay.AppCompat.ActionBar" >
但是,这会产生一个编译错误:
Error:Element type "application" must be followed by either attribute specifications, ">" or "/>".
是否有一种简单的方法来注释掉一行( block ),或者我应该打开一个外部文本编辑器并将原始( block )行复制并粘贴到该外部文本编辑器?
最佳答案
您可以在标签外评论,例如:
<application
android:allowBackup="true"
android:icon="@mipmap/myicon"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/ThemeOverlay.AppCompat.ActionBar" >
<!--android:theme="@style/AppTheme"-->
不在标签内。
关于android - 如何在 Android Studio 的 xml 中注释掉行)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33369450/