`
wang_peng1
  • 浏览: 3897230 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

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

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics