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很多快捷键用不惯。建议可以换
  

转载于:https://www.cnblogs.com/shansheng/p/4760202.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值