您的位置:首页 > 移动开发 > Android开发

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

2015-08-26 13:59 399 查看
使用过程中发现了一些与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很多快捷键用不惯。建议可以换
  
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: