51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 1083|回复: 0
打印 上一主题 下一主题

【转载】Android Studio 使用技巧(5)

[复制链接]
  • TA的每日心情
    擦汗
    10 小时前
  • 签到天数: 1047 天

    连续签到: 5 天

    [LV.10]测试总司令

    跳转到指定楼层
    1#
    发表于 2016-4-28 15:04:54 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    About Keymaps

    Android Studio provides different keymaps (the mapping between shortcut keys and an action). You can see which keymap you are using in Settings->Keymap.

    It wouldn’t be practical to list the shortcuts for every keymap so the following will be used:

    • Windows: Default
    • Linux: Default
    • OSX: Mac OSX 10.5+

    Enter vs Tab for Code Completion

    There is an interesting difference whether you use code completion with tab or with enter.

    Using enter will complete the statement as you would expect. Using tab will complete the statement and delete everything forward until the next dot, parenthese, semicolon or space.

    Shortcut (during code completion): enter or tab


    Navigate to parent

    If you are in a method that is overriding a parent class (e.g. Activity#onCreate()), this will navigate to the parent implementation.

    If you are on the class name, it will navigate to the parent class.

    Shortcut :

    • Mac: Cmd+U
    • Windows/Linux: Ctrl+U

    Return to the Editor

    A bunch of shortcuts will take you away from the editor (type hierarchy, find usages, etc.)

    If you want to return to the editor, your options are:

    • Escape: This will simply return the cursor to the editor.
    • Shift+Escape: This will close the current panel and then return your cursor to the editor.

    Shortcut :

    • Return and keep panel open: Escape
    • Close panel and Return: Shift+Escape

    Jump to Last Tool Window

    Sometimes, you return to the editor from a panel but find yourself having to go back to this panel. e.g. browsing find usages. With this, you can go back to a panel without your mouse.

    Shortcut: F12 (might interfere with the OS’s default keybindings)


    Hide All Panels

    Puts the editor in some sort of full screen mode. Invoking the shortcut a second time returns all panels to their previous state.

    Shortcut :

    • Mac: Cmd+Shift+F12
    • windows/linux: Ctrl+Shift+F12

    Open a Panel by Its Number

    You might have noticed that some of the panels have a number to the left of their name. This is a shortcut to open them!

    Just in case you don’t see the panel names, click the box thing in the lower left corner of the IDE.

    Shortcut :

    • Mac: Cmd+Number
    • windows/linux: Alt+Number

    Parameter Info

    This is the same list of parameter names as the one that appears when you are writing a method call. It is useful when you want to see an existing method’s params.

    The Parameter under your cursor will be in yellow. If nothing is in yellow, that means that the method call is not valid, probably something that is not casted right (e.g. a float in an int param).

    When you are writing a method call and you dismiss it by accident, like I usually do, you can also type a comma (,) to trigger the parameter info.

    Shortcut :

    • Mac: Cmd+P
    • windows/linux: Ctrl+P

    The Switcher

    So this thing is pretty much the alt+tab / cmd+tab of the IDE. It allows you to navigate to a tab or a panel.

    Once it is opened, as long as you hold the ctrl key, you can navigate quickly by using the number or letter shortcut. You can also close a tab or a panel by pressing backspace when it is selected.

    Shortcut: Ctrl+Tab


    Context Info

    So this will show you where you are when your scope definition is out of the scrolling area. Usually, this will be the name of the class or inner class but it might also be the current method name.

    Its better use, IMO, is to get a quick look at what the current class extends or implements.

    It also works in xml files.

    Shortcut: Ctrl+Shift+Q

    本文出自Cym的博客(http://blog.csdn.net/cym492224103


    分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
    收藏收藏
    回复

    使用道具 举报

    本版积分规则

    关闭

    站长推荐上一条 /1 下一条

    小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

    GMT+8, 2024-11-15 19:57 , Processed in 0.064106 second(s), 22 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

    快速回复 返回顶部 返回列表