您的位置:首页 > 其它

菜单的隐藏与现实(旋转)

2017-11-15 14:16 120 查看
public static void hider(ViewGroup v) {
hider(v,0);
}
public static void hider(ViewGroup v,int startOffset) {
//        RotateAnimation ra = new RotateAnimation(0,180,v.getWidth()/2,v.getHeight());
//        ra.setDuration(4000);
//        ra.setFillAfter(true);
//        ra.setStartOffset(startOffset);
//        v.startAnimation(ra);
//        for (int i = 0; i<v.getChildCount();i++){
//            View children = v.getChildAt(i);
//            children.setEnabled(false);
//        }

ObjectAnimator ani = ObjectAnimator.ofFloat(v,"rotation",0,180);
v.setPivot
a59b
X(v.getWidth()/2);
v.setPivotY(v.getHeight());
ani.setDuration(500);
ani.setStartDelay(100);
ani.start();
}
public static void show(ViewGroup v) {
show(v,0);
}
public static void show(ViewGroup v,int startOffset) {
//        RotateAnimation ra = new RotateAnimation(180,360,v.getWidth()/2,v.getHeight());
//        ra.setDuration(4000);
//        ra.setFillAfter(true);
//        ra.setStartOffset(startOffset);
//        v.startAnimation(ra);
//        for (int i = 0; i<v.getChildCount();i++){
//            View children = v.getChildAt(i);
//            children.setEnabled(true);
//        }
ObjectAnimator ani = ObjectAnimator.ofFloat(v,"rotation",180,360);
v.setPivotX(v.getWidth()/2);
v.setPivotY(v.getHeight());
ani.setDuration(500);
ani.setStartDelay(100);
ani.start();
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: