0
我正在构建我正在开发的应用程序的设计,并且我试图让图像淡入屏幕。但是,图像在转换成功时仍然不可见。这是代码:试图动画图像的阿尔法
facebookLoginButton = (ImageView)findViewById(R.id.facebookLoginButton); // Start of facebookLoginButton code
facebookLoginButton.setTranslationY(250f);
facebookLoginButton.setImageAlpha(0);
facebookLoginButton.animate().translationYBy(-250f).alpha(1).setDuration(1500); // End of facebookLoginButton code
我知道,因为当我删除facebookLoginButton.setImageAlpha(0);
,我看到的图像移动到屏幕上的图像成功移动。图像如何保持隐形?
注意:应用程序没有功能,这就是为什么我的按钮是ImageView。
谢谢你教我新的东西。但是,图像仍然不可见。 –
@ConnectionCoder想通了,检查编辑。 – Bryan
哇,谢谢你提供这个新信息!现在,我不必将图像属性下的初始Alpha设置为0。非常感谢你! –