`
阿尔萨斯
  • 浏览: 4170613 次
社区版块
存档分类
最新评论

Android Studio 100 tips and tricks

 
阅读更多

本文是想总结一些Android Studio的使用技巧,对于大多数习惯了使用eclipse的人来说,可能会需要一段时间,但是如果看过下面的一些介绍,你就能体会到Android Studio的强大之处了,不过本文列举的也只是冰山一角,深入了解后会有更多值得你发现的!

ps:由于时间关系,翻译可能有不全、有错,希望大家能一起修正,请在留言中指出,我会修正~thx


快捷提示:ctrl+space




按住ctrl+shift+上下键 可以将代码行上下移动


启动调试快捷键 alt+shift+F10




很多地方你都可以使用 ctrl+space 来补全、提示


在context menu上选择 Show Applied Styles For Tag 可以显示HTML的tag布局


快捷键 ctrl+shift+i 可以显示Image的相关信息


重命名快捷键 shift+f6


显示、隐藏导航菜单快捷键 alt+home


changes窗口可以显示所有的修改,快捷键 alt+f9


你可以选择eclipse的classpath或者project文件来导入一个eclipse文件


你可以显示选择对象的所有相关类、方法、变量 快捷键 ctrl+alt+f7


通过快捷键 atrl+shift+a 来打开寻找命令的搜索框


设置中可以通过搜索框来快速查找相关项


ctrl+shift+enter 可以让你在写完一些代码后自动帮你添加括号、分号


快捷键 ctrl+shift+f7 可以查看该类实现的所有接口信息


使用搜索框的时候,点击下拉箭头可以查看搜索历史


搜索的时候也可以使用 ctrl+ space 来补全


查看一个方法的所有返回点,可以通过ctrl+shift+f7来实现


在异常关键字上使用快捷键,ctrl+shift+f7 可以查看异常需要捕获的地方


alt+enter 来快速提示修改错误


ctrl+click来显示该文件所在目录下的其他文件


协同工作、版本控制相关


css文件中可以直接编辑颜色


在类名上点击alt+enter可以快速创建Test


按住alt进行选择,可以选中多列


通过不同颜色来区分文件


版本控制相关


系统自带了spell check


.dic文件定义了你要check的单词


版本控制相关


通过ctrl+tab 来在所有打开的文档中切换,按住ctrl,使用上下方向键、tab、shift+tab、alt来导航,使用delete、backspace来关闭文档


关闭其他tab的方法:右键点击选择、按住alt关闭


按住ctrl+shift+n来搜索相关文件


通过show diff来显示修改记录


在project上选择要比较的jar文件,按ctrl+d来比较


拆分显示


ctrl+space补全不需要按顺序输入


ctrl+f来搜索的时候,通过atrl+r来增加字段


在scope中可以选择相应的标记来查找


task list上可以通过ctrl、shift多重选择


run/debug可以分组管理






通过使用Emmet来加速HTML开发




在下面信息条可以选择结束的换行方式


通过file line separators来选择不同系统下的分隔符


ctrl+alt+shift+t来显示重构信息


可以添加收藏到favourites


文档也可以直接拖到收藏


你可以重新拖动来布局界面


tools下可以直接打开终端




自动完成后,可以自动从一个array中取值


自动完成后,可以自动从一个array中取值




自动提示后可以通过ctrl+shift+enter来选择当前的提示


自动补全里面通过!来补全其他代码


连续两次按 ctrl+space 可以显示所有相关


ctrl+enter可以选择第一个提示,如果你没有选择的话


自动提示里面可以选择排序方式


输入代码段后,你可以按ctrl+j来选择其他提示


通过alt+shift+click来创建多个cursor


快捷键 ctrl+shift+a来clone create


ctrl+q来显示文档信息


你可以选择show quick doc on mouse move来像eclipse一样悬浮提示文档


alt+f12来通过终端启动


按ctrl+space 2次可以导入其他命名空间下的提示


sql文也能提示了


ctrl+q 快速提示文档


通过ctrl+b来查看申明信息


重命名快捷键 shift+f6


ctrl+o快速重写方法,ctrl+i快速实现接口


智能类型提示快捷键 ctrl+shift+space 可以提示代码段


在使用自动补全的时候,你可以在弹出框中用tab来选择




alt+insert可以快速创建一些方法


直接输入关键字来搜索


ctrl+alt+t来选择模板代码




通过ctrl+alt+v来提取重构代码


自动注释 ctrl+/ ctrl+shift+/




ctrl+d来复制一行


通过tab来使用模板


ctrl+e来实现历史记录查找


shell也可以自定义


弹出提示的时候通过ctrl+上下箭头来选择

分享到:
评论

相关推荐

    Android代码-震惊!如此多的Android开发技巧!!!

    一些很不错的Android开发技巧,这个项目翻译自 android-tips-tricks 去掉了一些我认为不重要的,对我使用过的东东做了评价,同时翻译了一些自己没有注意到的知识点的文章。 :heart: star 支持一下 欢迎协作 了解你的...

    Gradle for Android

    Finally, you will be shown a number of tips and tricks on the advanced customization of your application's build process. By the end of this book, you will be able to customize the entire build ...

    Gradle for Android(PACKT,2015)

    Finally, you will be shown a number of tips and tricks on the advanced customization of your application's build process. By the end of this book, you will be able to customize the entire build ...

    Gradle.for.Android.1783986824

    Finally, you will be shown a number of tips and tricks on the advanced customization of your application's build process. By the end of this book, you will be able to customize the entire build ...

    android-tips-tricks:[备忘单] Android开发的提示和技巧

    有关Android开发的提示和技巧的备忘单。 这是我从各种来源收集到的一组有关Android开发的简单提示和技巧。 它可以帮助我指导社区中的其他android开发人员有关每个android开发人员应了解的知识。 我也可以随时随地...

    CommonsWare.The.Busy.Coders.Guide.to.Android.Development.Version.8.2.2017

    Android Studio Editors and Dialogs Advanced Emulator Capabilities Lint and the Support Annotations Using Hierarchy View Screenshots and Screencasts ADB Tips and Tricks Issues with Speed Finding CPU ...

    The Busy Coders Guide to Android Development最终版2019

    Android Studio Editors and Dialogs Advanced Emulator Capabilities Lint and the Support Annotations Inspecting Layouts Screenshots and Screencasts ADB Tips and Tricks Stetho Issues with Speed Finding ...

    Android.Programming.The.Easy.Way

    This step-by-step guide has examples on every page and is filled with bonus tips and tricks to make your app stand out. If you follow this guide you will have a completed app in as little as one day. ...

    Apress.Practical.Flutter

    In addition to building these apps, you'll have the benefit of reviewing real-world issues you might encounter, along with ways to deal with them through tips and tricks, all designed to make your ...

Global site tag (gtag.js) - Google Analytics