Android Studio - 自动关闭标签 - 在新行中关闭 [英] Android Studio - automatic tag closing - close in new line

查看:41
本文介绍了Android Studio - 自动关闭标签 - 在新行中关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 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 -> 中寻找这样的选项设置 ->编辑器,但我找不到.

推荐答案

转到文件 -> 设置(或单击Ctrl+Alt+S 进入设置),从下拉菜单中展开编辑器,然后展开代码样式并点击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 - 自动关闭标签 - 在新行中关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆