解决方案 »
- android SDK的问题
- extends View 动画的实现
- 求教 用asmack向openfire注册时 如何增加vcard信息
- 请问下如何获取桌面及使用其他软件的触摸点轨迹.
- activity跳转的问题
- ERROR: APK path is not specified for module "Dict"
- Android app问题
- 新手求教:如何通过蓝牙将手机变成HID输入设备
- 360桌面的魔法手指是怎么实现的?
- 如何在android上实现PDF的下划线、批注功能???
- ExpandableListView SimpleExpandableListAdapter 添加数据报错
- android:layout_marginRight
Sets the opacity of the view. This is a value from 0 to 1, where 0 means the view is completely transparent and 1 means the view is completely opaque.
大概的意思是:0是完全透明的,1是完全不透明
根据自己想要的效果写成算法,将变量放进setAlpha()方法里,变量取0-1之前的float,这样就可以达到渐变的效果。如下:
setAlpha(0);
setAlpha(0.1);
setAlpha(0.2);
...
setAlpha(1);
这只是个例子,你也可以是0.01或者更小。
final TransitionDrawable td =
new TransitionDrawable(new Drawable[] {
new ColorDrawable(android.R.color.transparent),
new BitmapDrawable(mResources, bitmap)
});
imageView.setImageDrawable(td);
td.startTransition(400);