正如标题所暗示的 inDither
BitmapFactory.Options
中的字段现在已弃用。 Android 文档说“此字段在 API 级别 24 中已弃用。从 N 开始,此字段被忽略。”有谁知道为什么它已被弃用,是否有替代方案?
最佳答案
好像来不及回答了……
如果您使用 canvas.drawBitmap ,你可以试试:
Paint().apply {
isDither = false
isFilterBitmap = false
isAntiAlias = false
}
对于 图像查看 , setLayerPaint 好像不太合适,可以创建位图可绘制 喜欢:BitmapDrawable(resources, bitmap).apply {
setAntiAlias(false)
isFilterBitmap = false
}
关于android - 在 android N 中不推荐使用 InDither,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42135348/