使用TransitionDrawable实现渐变效果

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

    private void setImageBitmap(ImageView imageView, Bitmap bitmap) {  
        final TransitionDrawable td = new TransitionDrawable(new Drawable[] {  
                new ColorDrawable(android.R.color.transparent),  
                new BitmapDrawable(getResources(), bitmap) });  
        imageView.setBackgroundDrawable(imageView.getDrawable());  
        imageView.setImageDrawable(td);  
        td.startTransition(200);  
    }