Android Studio 快速注释代码的方法

1.选中一行或几行代码,按“Ctrl + /”可以通过给每行前面添加“//”的方式注释代码。

再次按“Ctrl + /”可以取消注释

2.

选中一行或几行代码,按“Ctrl + Shift+/”可以给将代码块注释在“/*”和“*/”中

再次按“Ctrl + Shift+/”可以取消注释

  • 9
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Android Studio代码调试大全 快捷键查找表 速查表列出了 keymap 快捷键的名称. 可以直接通过 AS setting 界面搜索 keymap . 通过对应的快捷键名称来添加或者修改快捷键. 功能描述 keymap对应名字 Mac Win/Linux 提示错误解决方案 Show Intention Actions option + enter alt + enter AS配置界面 Preferences command + , control+alt+S 工程项目配置界面 Project Structure command + ; Control+Alt+Shift+S 快速构成代码 Code Generate command + N alt + insert 代码提示 Completion/Basic control + space (mac会冲突, 手动修改) ctrl + 空格 (win同样大部分和输入法冲突, 手动修改) 选择视图 select in any view option + F1 alt + F1 添加书签标识 Toggle Bookmark option + F3 ctrl + F11 向下移动一行 Move Line Down option + shift + Down alt + shift + Down 向上移动一行 Move Line Up option + shift + Up alt + shift + Up 注释代码 Comment with Line Comment command + / ctrl + / 用代码模板包裹代码 surround with Live Template command + option + J ctrl + alt + J 格式化代码 Reformat Code command + option + L ctrl + alt + L Copy Reference Copy Reference command + option + shift + C ctrl + alt + shift + C if/try等包裹代码 Surround With.. command + option + T ctrl + alt + T 查看声明 Declaration command + B ctrl + B 快捷向下复制行 Duplicate Line or Block command + D ctrl + D 删除行 Delete Line command + delete ctrl + Y 快捷最近打开 Recent Files command + E ctrl + E 查找 Edit/Find/Find command + F ctrl + F 文件方法结构 File Structure command + F12 ctrl + F12 显示书签 Show Bookmarks command + F3 shift + F11 代码高亮向下查找 Move To Next Occurrence command + G F3 代码高亮向上查找 Move To Previous Occurrence command + shift + G shift + F3 按照模板生成代码 Insert Live Template command + J ctrl + J 定位到行 Navigate/Line command + L ctrl + G 快速到行首/尾 Move Caret to Line Start/End command + Left/Right ctrl + Left/Right 代码折叠/展开 Collapse/Expand command + 减号/加号 ctrl + 减号/加号 查找类 Navigate/Class command + O ctrl + N 多行注释 Code/Comment command + option + / ctrl + alt + / 格式化代码 Reformat Code command + option + L ctrl + alt + L 提示参数类型 Parameter Info command + P ctrl + P 查找替换 Replace command + R ctrl + R 查找命令 Find Action command + shift + A ctrl + shift + A 拷贝文件路径 Copy Paths command + shift + C ctrl + shift + C 移动代码块 Move Statement Up/Down command + shift + down/up ctrl + shift + down/up 代码补全 Complete Current Statement command + shift + enter ctrl + shift + enter 全路径查找 Find in Path command + shift + F ctrl + shift + F 代码高亮 Highlight Usages in File command + shift + F7 alt + J 窗口内所有代码折叠/展开 Collapse/Expand All command + shift + 减号/加号 ctrl + shift + 减号/加号 查找文件 Navigate/File command + shift + O ctrl + shift + N 全路径中替换 Replace in Path command + shift + R ctrl + shift + R 大小写转换 Toggle Case command + shift + U ctrl + shift + U 显示粘贴版历史 Paste from History command + shift + V ctrl + shift + V 快速查找定义 command + space ctrl + shift + I 粘贴 Paste command + V ctrl + V 复制 Copy command + C ctrl + C 去除无效包引用 Optimize Imports control + option + O ctrl + alt + O 显示类关系继承体系 Type Hierarchy control + H ctrl + H 快速覆写方法 override Methods control + O ctrl + O 查找调用的位置 Call hierarchy control + option + H ctrl + alt + H 添加书签 Toggle Bookmark F3 F11 扩大缩小选中范围 Extend Selection/Shrink Selection option + UP/Down ctrl + W + shift + W 跳转到父类 Super method command + U ctrl + U 关闭当前tab标签 Editor Tabs / Close command + W ctrl + shift + a 关闭除编辑窗口的其余窗口 Hide All Tool Windows command + shift + F12 ctrl + shift + F12 预览方法定义 Quick Definition command + Y ctrl + shift + I 返回光标最后编辑位置 Last Edit Location command + shift + delete control + shift + Backspace 调到代码块首部/尾部 Move Caret To Code Block Option + Command + [ 或者 ] Control+[ 或者 ] 重命名 Rename shift + F6 shift + F6 抽取方法 Extract Method command + option + M control+alt+M 抽取变量 Extract Variable command + option + V control+alt+V 抽取字段 Extract Field command + option + F control+alt+F 抽取常量 Extract Constant command + option + C control+alt+C 抽取参数 Extract Parameter command + option + P control+alt+P 重构入口 Refactor This control + T ctrl + alt + shift + T

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值