读书人

dither颤动的使用

发布时间: 2012-09-24 13:49:41 作者: rapoo

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

读书人网 >移动开发

热点推荐