【问题标题】:Android Studio - automatic tag closing - close in new lineAndroid Studio - 自动标签关闭 - 在新行中关闭
【发布时间】:2016-10-12 15:27:38
【问题描述】:

我使用的是 Android Studio 0.8.6

我想改变标签自动关闭的方式。

现在看起来像这样:

<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

我想要这样的东西:

<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" 
/>

因为当我想复制最后一个属性时 - 我不能只选择整行,因为标签结尾在那里。

我在File -&gt; Settings -&gt; Editor 中寻找这样的选项,但找不到。

【问题讨论】:

    标签: autocomplete android-studio


    【解决方案1】:

    进入文件 -> 设置(或点击Ctrl+Alt+S进入设置) ,从下拉列表中展开 Editor,然后展开 Code Style 并点击 XML。然后从右侧显示的选项卡中单击 Android 选项卡。然后看看这些部分 - 其中一个有标题:Layout Files。勾选布局文件部分中在最后一个属性后插入换行符旁边的复选框。单击应用,然后单击确定,然后转到您的 XML 文件并重新格式化代码 (Ctrl+Alt+S)。

    【讨论】:

    • 嗯,它对我有用。但不幸的是,/&gt; 的缩进级别与其中一个属性相同,这破坏了明确指示的整个目的,标签在哪里结束,似乎没有选项可以解决这个问题!
    猜你喜欢
    • 1970-01-01
    • 2019-05-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-05-16
    • 2014-08-09
    • 2018-05-17
    相关资源
    最近更新 更多