Android Studio代码风格

时间:2015-02-08 17:26:47

标签: intellij-idea android-studio

如何更改代码样式,以便Reformat code在这种情况下不会删除换行符:

DrawerItemInterface[] menu = new DrawerItemInterface[] {
    DrawerHeaderItem.create(100, "Header"),
    DrawerItem.create(101, "Item", false, getActivity())
};

执行Reformat code给了我这个垃圾:

DrawerItemInterface[] menu = new DrawerItemInterface[]{DrawerHeaderItem.create(100, "Header"), DrawerItem.create(101, "Item", false, getActivity())};

1 个答案:

答案 0 :(得分:1)

转到设置 - >代码风格 - >然后Java在右侧,检查换行符。然后它应该按预期工作

enter image description here