随笔分类 -  Android

摘要:TranslateAnimation详解 Android JDK为我们提供了4种动画效果,分别是: AlphaAnimation,RotateAnimation, ScaleAnimation, TranslateAnimation. TranslateAnimation是移动的动画效果。它有三个构造函数,分别是: public TranslateAnimation(Context context,AttributeSet attrs) public TranslateAnimation(float fromXDelta, float toXDelta, float fromYDelt... 阅读全文
posted @ 2013-07-25 18:42 kevin.m 阅读(1824) 评论(0) 推荐(0)
摘要:需要确定组件在父窗体中的坐标时,使用getLocationInWindow,需要获得组件在整个屏幕的坐标时,使用getLocationOnScreen。其中location [0]代表x坐标,location [1]代表坐标。1 int[] location = new int[2] ;2 3 /**获取在当前窗口内的绝对坐标,getLeft , getTop, getBottom, getRight, 这一组是获取相对在它父窗口里的坐标。*/4 view.getLocationInWindow(location); 5 //获取在整个屏幕内的绝对坐标,注意这个值是要从屏幕顶端算起,也就是.. 阅读全文
posted @ 2013-07-25 18:36 kevin.m 阅读(1872) 评论(0) 推荐(0)