当前,我使用以下方法设置LinearLayout的背景
BitmapDrawable bd = new BitmapDrawable(getResources(), mBlurredMap);
mLytProfileCover.setBackground(bd);我怎么能动画这个?例如,在淡入动画中,背景的alpha值从0变为1/500‘s。
谢谢。
发布于 2017-03-29 14:46:12
ObjectAnimator alphaAnimator = ObjectAnimator.ofFloat(mLytProfileCover, View.ALPHA, 0.0f, 1.0f);
alphaAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(final Animator animation) {
mLytProfileCover.setBackground(bd);
}
});
alphaAnimator.setDuration(500);
alphaAnimator.start();https://stackoverflow.com/questions/43096385
复制相似问题