1、从xml中获取string的时候,在String.xml中的字符串,直接通过context.getString()获取,不必要在getresource().getString()

2、围绕自身旋转

mRotateAnimation = new RotateAnimation(0, 720, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
0.5f);
mRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
mRotateAnimation.setDuration(ROTATION_ANIMATION_DURATION);
mRotateAnimation.setRepeatCount(Animation.INFINITE);
mRotateAnimation.setRepeatMode(Animation.RESTART);

 

3、可滚动的控件到边界的时候,都会有fadingedge效果,如何禁止掉这种效果呢,2.3之前可以设置android:fadingEdge="none",之后可以通过在代码中设置setOverScrollMode(OVER_SCROLL_NEVER);

4、onFinishInflate在inflate完成后调用,可以在这里边获取mChildRootView = getChildAt(0);根元素

5、获得根视图

(1)getWindow().getDecorView().findViewById(android.R.id.content):这个是获取activity中rootview的方法

(2)((ViewGroup)findViewById(android.R.id.content)).getChildAt(0):这个是获取viewgroup中rootview的方法。

6、屏幕截图 http://www.eoeandroid.com/thread-199786-1-1.html

7、事件机制http://www.cnblogs.com/sunzn/archive/2013/05/10/3064129.html

8、事件代理:http://lilymarry.me/?p=10

9、系统的对view的常亮都在ViewConfiguration里边。

posted on 2015-07-31 14:42  猿类的进化史  阅读(212)  评论(0编辑  收藏  举报