与同步结合在一起网页视图,以减少负荷超过500kb的文件 [英] Synchronizing and combining webviews together to reduce loading for files over 500kb

查看:108
本文介绍了与同步结合在一起网页视图,以减少负荷超过500kb的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是问题的一个长期装载了的WebView 500KB的延续。

This question is a continuation of "loading long webview over 500kb".

因此​​,作为主题建议过来500KB长减小文件加载。我的想法是使用网页视图5并在其显示在屏幕上的UI线程合并在一起。原因是5网页视图应该使它装载似乎更快,因为它仅需要加载当前总的数据串的20%至被放置在网页视图。

So as the topic suggest it reduces file loading over 500kb long. My idea was to use 5 webviews and merge them together on a UI threading which displays them on the screen. Reason for this is 5 webviews should make it loading seem faster since it only requires to load 20% of the current total data string to be placed in the webview.

现在的问题实际上是同步达到最大滚动索引的时候它意义webview1去这去webview2和web视图会滚动索引下会回到webview1事件处理程序。这适用于所有网页视图。可能有人告诉我去一个覆盖事件处理函数,当滚动越过量的初始100%,然后,它给我的处理程序。

Now the problem is actually synchronizing it meaning webview1 when reaching the maximum scrolling index goes to an event handler which goes to webview2 and webview going under the scrolling index would go back to webview1. This applies to all webviews. Could someone direct me to an override event handler that when the scroll goes over the initial 100% of the amount it then gives me the handler.

推荐答案

如果有可能的简单办法是分割数据到不同的意见,那么你可以使用的 AbsListView.OnScrollListener (仅适用于AbsListView而不是网页视图)和列表或网格视图present的不同的看法。这似乎是比视图之间切换更清洁的方式,但我不知道你怎么会有你的布局,也许这是不可能的。你将不得不安排您的看法成一个列表,然后呈现在回地面线每一个视图,并把它推回视图时它已准备就绪。你应该看看 PullToRefresh 关于如何做一个很好的例子。

If it is possible the simpler option would be to split the data into separate views, then you could use a AbsListView.OnScrollListener (only available with AbsListView and not WebView) and a list or grid view to present the different views. This seems like a much cleaner way than switching between views but I don't know how you have your layout and perhaps this isn't possible. You would have to arrange your views into a list and then render each view on a back ground thread and push it back into the view when it is ready. You should check out PullToRefresh for a great example on how to do this.

如果上述不适合你的另一个选择是使用 onTouchEvent 的通知您,当一个用户可能会滚动,并尝试计算使用任何滚动偏移量方法可用在布局/视图,当你已经见底,但这是非常复杂的。 滚动型有方法,如果你有超过滚动这可能有助于通知您

If the above doesn't suite you another option would be use the onTouchEvent to inform you when a user might be scrolling and try calculate using whatever scroll offset methods are available in your Layout/View, when you have hit the bottom but this is very complex. ScrollView has methods to inform you if you have over scrolled which might help

这篇关于与同步结合在一起网页视图,以减少负荷超过500kb的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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