首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

dither颤动的使用

2012-09-24 
dither抖动的使用今天做东西时感觉使用一下抖动效果好看一下,当然有时候不明显,如果你需要看明显的效果的

dither抖动的使用

今天做东西时感觉使用一下抖动效果好看一下,当然有时候不明显,如果你需要看明显的效果的话 就应该方法图片来看

<?xml version="1.0" encoding="UTF-8"?><bitmap    xmlns:android="http://schemas.android.com/apk/res/android"    android:src="@drawable/b1"    android:dither="true" />
<?xml version="1.0" encoding="UTF-8"?><bitmap    xmlns:android="http://schemas.android.com/apk/res/android"    android:src="@drawable/b1"    android:tileMode="repeat"    android:dither="true" />
findViewById(R.id.ImageView01).getBackground().setDither(true);

如果要引用上面的可以设置 drawable来实现,

但是抖动不能直接应用在dialog中,因为里面的背景通常是透明 transparent 的,

可以间接使用getWindow().setFlags(WindowManager.LayoutParams.FLAG_DITHER, WindowManager.LayoutParam

热点排行