使用ObjectAnimator的空指针
来源:互联网 发布:godaddy域名注册流程 编辑:程序博客网 时间:2024/04/29 13:21
ObjectAnimator animator = new ObjectAnimator();animator.setDuration(300);animator.ofFloat(mBottomContainer, "scaleX", 0.0f, 1.0f);animator.setInterpolator(new AccelerateInterpolator());animator.start();
程序会报出空指针。因为animator.ofFloat(mBottomContainer, "scaleX", 0.0f, 1.0f);这个是ObjectAnimator类的静态方法,在方法中会重新创建一个ObjectAnimator的对象,所以导致animator没有设置上Target,顾报出空指针。
解决
ObjectAnimator animator = ObjectAnimator.ofFloat(mBottomContainer, "scaleX", 0.0f, 1.0f);animator.setDuration(300);animator.setInterpolator(new AccelerateInterpolator());animator.start();
0 0
- 使用ObjectAnimator的空指针
- Android objectAnimator的使用
- ObjectAnimator的简单使用
- ObjectAnimator的使用
- ObjectAnimator简单的使用
- ObjectAnimator的简单使用
- ValueAnimator及ObjectAnimator的使用
- ViewStub的一些使用空指针问题
- 属性动画ValueAnimator和ObjectAnimator的使用
- 使用ObjectAnimator时遇到的一些问题
- 属性动画05-ObjectAnimator的高级使用
- 空指针的利用
- 莫名的空指针
- SurfaceView的使用以及空指针异常的处理
- 使用butterknife报空指针
- iText使用PdfCopy时出现的空指针问题
- 对空指针使用delete是安全的
- 再使用java list的时候出现空指针异常
- Jungle Roads - 1251
- ConcurrentHashMap的putIfAbsent方法
- JavaScript字符串转数字
- OpenResty 反代理项目分享[严禁转载]
- android 获取video列表和缩略图 亲测()
- 使用ObjectAnimator的空指针
- 也将纳入生育技术人员说人家夜深人静
- 函数中递归的变现形式
- 个性化Jenkins(Hudson)的邮件通知
- Unity 3D引擎:十大最火的插件推荐
- 第十七篇:计算代码行数练习代码
- jdbc连接 mysql 数据库
- Android无法导入下载好的项目(和Eclipse中已经存在的项目命名一样导致冲突)解决办法
- 企业CIO