这是我原来的 .axml 文件。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ListView android:id="@+id/List"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:cacheColorHint="#00000000"
/>
</LinearLayout>
我正在保存并按照惯例点击Ctrl+S
,但随后我又意外地再次点击了S
而没有放开Ctrl
,因此我有效地点击Ctrl+S+S
。这导致代码格式如下:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ListView
android:id="@+id/List"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:cacheColorHint="#00000000" />
</LinearLayout>
请注意,这与我习惯的Ctrl+E+D
快捷方式不同,导致代码格式不同,如下所示。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ListView
android:id="@+id/List"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:cacheColorHint="#00000000" />
</LinearLayout>
我的问题是......我究竟做了什么?我不小心调用了什么功能或宏?我已经在普通的 .cs 文件以及 .xml 文件上测试了这个组合键,这个键盘组合在那里没有做任何事情。我快速浏览了工具 - &gt;选项 - &gt;键盘,但噪音太大,我无法合理地过滤它(据我所知)。在任何情况下,我之前都没有更改此VS实例中的任何内容,也没有安装ReSharper之类的东西。