android studio或者IntelliJ代码样式的设置

使用过程中发现了一些与Eclipse不同的地方,在这里提供一些设置方法
 
1. Backspace会将开头的空格和换行符一并删除,如果要禁用
Settings -> Editor -> General -> Smart Keys -> Backspace -> Unindent: 可
以设为Disabled
 
2. switch/case中的case会被自动缩进一级
Settings -> Editor -> Code Style -> Java -> Wrapping and Braces ->
'switch' statement -> Indent 'case' branches 不选
 
3. xml格式与eclipse默认完全不一致,没有找到完全相同的设置方法,只能基本相似
Settings -> Editor -> Code Style -> XML -> Tabs and Indents ->
Continuation indent: 设成4
Settings -> Editor -> Code Style -> XML -> Other -> Align attributes 不选
Settings -> Editor -> Code Style -> XML -> Other -> Spaces -> In empty
tag 选
Settings -> Editor -> Code Style -> XML -> Other -> Android -> Use
custom formatting settings for Android XML files 选
 
4. 如果对代码中写死的汉字字符串过敏
Settings -> Editor -> General -> Code Folding -> Android String
References 不选
 
5.如果Eclipse转到android studio很多快捷键用不惯。建议可以换
  
posted @ 2015-08-26 13:59  Mulberry_yan  阅读(1732)  评论(0编辑  收藏  举报