gpt4 book ai didi

Android:ViewProperty Animator 无法在 3.0 模拟器上运行

转载 作者:行者123 更新时间:2023-11-30 04:07:12 24 4
gpt4 key购买 nike

我在我的应用程序中使用了一些 Viewproperty 动画。一旦它在 android 3.0 平板电脑上编译它工作正常,如果在 3.0 模拟器上运行应用程序崩溃并在 logcat 上显示错误。

代码:

ImageButton home = (ImageButton)findViewById(R.id.Home);
home.animate().setDuration(200);
smmslogo.animate().alpha(1);

错误:

java.lang.NullPointerException
at android.view.ViewPropertyAnimator.animatePropertyBy

谁能帮帮我?

最佳答案

我认为崩溃与 http://code.google.com/p/android/issues/detail?id=18803 处的错误有关

尝试使用此调用:

ObjectAnimator.ofFloat(home, "alpha", 0f, 1f).setDuration(200).start();

关于Android:ViewProperty Animator 无法在 3.0 模拟器上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11412051/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com