課程
/移動開發
/Android
/Android屬性動畫賞析
使用泛型的那個TypeEvaluator()---如何通過改變PointF的坐標來實現動畫效果?希望老師給一些提示或者Demon,謝謝@ecplise_xu
2016-01-18
源自:Android屬性動畫賞析 1-4
正在回答
???? final?Button?btn=(Button)?findViewById(R.id.btn1); ???? ValueAnimator?animator=ValueAnimator.ofObject(new?TypeEvaluator<PointF>() { @Override public?PointF?evaluate(float?fraction,?PointF?start,?PointF?end) { float?x=(end.x-start.x)*fraction; float?y=(end.y-start.x)*fraction; btn.setX(x); btn.setY(y); return?null; } },new?PointF(1,?1),new?PointF(300,300)); ???? animator.setDuration(5000); ???? animator.start(); ???? ???? 勉強看??格式亂了
Listener
舉報
本次課程,將向你介紹如何使用屬性動畫做出更好的動畫
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2016-03-09