Android Studio 使用小技巧

Android Studio 使用小技巧

1.提取Style

(1)

clipboard.png

或者直接使用快捷键 Ctrl + Alt + Shift + T

clipboard.png

(2)设置名称,需要提取的属性

clipboard.png

(3) 然后就会自动在 Values->styles.xml 文件中生成对应的Style

Untitled.png

2.Shift + F6

给方法,变量或者文件重命名。 全局改,就是所有用到的地方都改。

3.关于颜色使用

可以直接使用谷歌提供的

android:background="@android:color/black"

btn.setBackgroundResource(android.R.color.black);

4.关于 for 循环 ,If 的快捷写法

for:

1.gif.gif.gif

增强for循环:

1.gif.gif

if:

1.gif

else 就是取反:

1.gif.gif

更多请参考:

Untitled.png

5.快捷键

(1)查找类文件 Ctrl +N

(2) 查找文件 Ctrl+Shift+N

(3)Ctrl+Shift+Enter 状态完成

就是比如你输入 Button button=new Button(this) ,按下快捷键后,自动完成 “ ;”

(4)打开最近修改文件 Ctrl+E

更多请参考:

  1. http://blog.csdn.net/yissan/article/details/53374437
  2. http://www.jb51.net/article/87030.htm
  3. https://developer.android.com/studio/intro/keyboard-shortcuts.html
  4. **http://www.androidchina.net/6047.html **

posted @ 2017-09-30 15:27  -Tiger  阅读(548)  评论(0编辑  收藏  举报