Android的观点抖动 [英] Android view dithering

查看:187
本文介绍了Android的观点抖动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如你可以从下面的截图中看到,在标题栏越来越横跨地区,这些丑陋的条纹线条与文字,扩展了屏幕的整个宽度。它的影响会更加明显真实设备上。

As you can see from the screenshot below, the "titlebar" is getting these ugly banding lines across the areas with text that extend the entire width of the screen. It's even more noticeable on a real device.

有没有什么办法来解决呢?

Is there any way to work around this?

推荐答案

Android开发者:小工具设计指南

在一些情况下,设备具有低的像素   深度,可引起视觉绑扎   和抖动的问题。解决这个问题,   应用程序开发者应该通过   通过代理绘制资产   定义为XML:。这种技术   引用原始艺术品,​​在   这种情况下,background.9.png,和   指示设备来抖动它作为   必要的。

In some cases, devices have low pixel depths that can cause visual banding and dithering issues. To solve this, application developers should pass assets through a "proxy" drawable defined as XML:. This technique references the original artwork, in this case "background.9.png", and instructs the device to dither it as needed.

编辑: 示例源。这是你的 RES /可绘制目录中的XML文件:

Example source. This is an xml file in your res/drawables directory:

<?xml version="1.0" encoding="UTF-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
    android:src="@drawable/title_bar_medium"
    android:dither="true" />

这篇关于Android的观点抖动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆