问题描述
我正在使用Android Studio 0.8.6
Im using Android Studio 0.8.6
我想更改自动关闭标签的方式.
I want to change way how tags are automatically closed.
现在看起来像这样:
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
我想要这样的东西:
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
因为我要复制最后一个属性-我不能只选择整行,因为标签结尾在那儿.
because when I want to copy last attribute - I can't just select whole line because tag end is there.
我正在File -> Settings -> Editor
中寻找这样的选项,但找不到.
I was looking for such option in File -> Settings -> Editor
, but I can't find it.
推荐答案
转到文件 -> 设置(或单击 Ctrl + Alt + S 进入设置"),从下拉菜单中展开 Editor ,然后展开 Code Style ,然后点击 XML >.然后从右侧显示的标签中点击 Android 标签.然后查看这些部分-其中一个标题为:布局文件.选中布局文件"部分中的在最后一个属性之后插入换行符旁边的复选框.点击应用,然后点击确定,然后转到您的XML文件并重新格式化代码(Ctrl + Alt + S).
Go to File -> Settings (or click Ctrl+Alt+S to go to Settings), expand Editor from the drop-down, then expand Code Style and click XML. Then click Android tab from the tabs displayed on the right hand side. Then have a look at the sections - one of them has title: Layout Files. Tick the check-box next to Insert line break after last attribute within Layout Files section. Click Apply, then OK, then go to your XML file and reformat code (Ctrl+Alt+S).
这篇关于Android Studio-自动关闭标签-在新行中关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!