开发者

Android WebView - Dithering/Changes on Tap

开发者 https://www.devze.com 2023-04-13 04:35 出处:网络
I am currently 开发者_StackOverflow社区working on an application that requires the use of a WebView. It basically takes up the entire screen space.

I am currently 开发者_StackOverflow社区working on an application that requires the use of a WebView. It basically takes up the entire screen space.

Initially the images inside of the WebView look fine and high quality. Unfortunately, when a user taps (and holds) a button in the webview, the images then lose quality and dither until the finger is released. Is there any way to disable this?

A good note, my app does not need any scrolling whatsoever. I thought Android would only lower the quality on scroll to better performance.


the only solution is to make your own image viewer, the webview resamples images at lower qualities


I've been dealing with the same issue for a long while. The best solution is to split the image into several sub-images and load them altogether within the same html file.

The easiest and fastest solution I found is with Adobe Photoshop:

  1. Open you image
  2. Create horizontal and vertical guides
  3. Select the Slicing tool and activate the "create slices from guides"
  4. Save for web (I'm not using the English version, but you get what I mean)
  5. Select your desired image format
  6. Save, but while saving check the option "Html and images"

With this, you'll avoid dithering with any image as long as you split it into enough pieces,

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号