Android的5屏毛刺/静态与Viewpager内的谷歌地图碎片 [英] Android 5 screen glitch/static with Google Maps Fragment inside a Viewpager

查看:206
本文介绍了Android的5屏毛刺/静态与Viewpager内的谷歌地图碎片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有关系到Android 5和谷歌地图与Viewpager和片段结合一个奇怪的问题,希望从你们..得到一些很好的想法。

I am having a strange issue related to Android 5 and Google Maps combined with a Viewpager and Fragments, hoping to get some good ideas from all of you..

问题的截图: http://postimg.org/image/6wzssbdbr/ (无代表内联还)

Screenshot of the problem: http://postimg.org/image/6wzssbdbr/ (no rep for inlining yet)

情况:


  • 用Viewpager主要活动有一些片段的

  • 一个片段里面有它的MapView与转发所有的生命周期方法;与MapsFragment替换图形页面和问题是一样的

  • 打开一个新的活动,只要新的活动没有使用太多的内存(我假设),主要活动的的onDestroy不叫和故障发生时,如果的onDestroy被调用,毛刺不会发生

  • 这次活动有一个输入字段卡号和这个活动被打开时,我看到上面的截图。

如果我去从第二个活动到后面第一个我也得到了一些奇怪的,屏幕的底部将被复制到顶部,与周围一些静态显示有

If I go back from the second Activity to the first I also get something strange, a bottom part of the screen is copied to the top and shown there with some static around it.

与Android 4的设备没有问题,我针对最新的SDK,使用最新版本的工具。

Devices with Android 4 don't have the problem, I am targeting the latest SDK, using the latest build tools.

如果我删除片段在Viewpager与它里面的谷歌地图,没有问题。

If I remove the Fragment in the Viewpager with the Google Maps inside it, no issue.

这工作做的唯一事情是安卓hardwareAccelerated ='假',但你可能想象这会减慢应用程序。

The only thing that did work is android:hardwareAccelerated='false' but as you might imagine this slows down the app..

任何建议/想法,欢迎..我试过围绕4-5不同的事情,到目前为止,只有机器人。hardwareAccelerated作品

Any suggestions/ideas are welcome.. I tried around 4-5 different things so far and only android:hardwareAccelerated works.

感谢您的阅读,

丹尼

编辑:

(没有足够的代表处发布2个以上环节,让下面的链接,而不在它前面的code.google.com)
谷歌code问题:

(Not enough rep to post more than 2 links, so links below without the code.google.com in front of it) Google code issues:


  • 我的问题在这里报道] - > / P / GMaps实现-API的问题/问题/细节ID = 7391,因为我认为这是特定的映射

  • My issue is reported here] -> /p/gmaps-api-issues/issues/detail?id=7391 because I thought it was maps specific

类似的问题在这里找到 - > / P /安卓/问题/细节ID = 81832报道的Andr​​oid漏洞

Similar issue found here -> /p/android/issues/detail?id=81832 reported in Android bugs

#1类似的问题:的Andr​​oid SystemUI毛刺

推荐答案

地址:

android:hardwareAccelerated="false"

你的活动或应用程序清单条目。这解决方法禁用硬件加速图形,所以不要掉以轻心。有至少一个bug报告到谷歌类似的视觉干扰,避免你的,希望他们快速解决问题。

to your Activity or Application manifest entry. This workaround disables hardware accelerated graphics, so don't take this lightly. There is at least one bug report into Google for similar visual glitches to yours, hopefully they get this resolved quickly.

我不建议把这个变成一个航运的应用程序,只能证明或反驳你的绘图故障是由于与底层硬件加速系统问题。

I wouldn't recommend putting this into a shipping app, only to prove or disprove that your drawing glitches are due to problems with the underlying hardware acceleration system.

您也可以尝试通过在视图级别禁用硬件加速:

You can also try disabling hardware acceleration at the View level via:

view.setLayerType(View.LAYER_TYPE_SOFTWARE, null);

特别是如果你有的WebView,层类型设置为上的WebView软件在我的应用程序去对解决UI毛刺很长的路要走。

in particular if you have WebView's, setting layer type to software on WebView's in my app went a long way towards resolving UI glitches.

这篇关于Android的5屏毛刺/静态与Viewpager内的谷歌地图碎片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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