简体   繁体   English

加载链接后如何设置Webview区域?

[英]How to set webview area upon loading a link?

Ok so I have an rss reader that links to articles. 好了,我有一个链接到文章的RSS阅读器。 One of the sites it links to doesn't have a mobile view. 它链接到的网站之一没有移动视图。 I was wondering if anyone knew if it was possible to set the "zoom" and position of the view once the page is loaded? 我想知道是否有人知道加载页面后是否可以设置视图的“缩放”和位置? So for instance if the following link were my article... http://www.neworleanssaints.com/news-and-events/article-1/Saints-agree-to-terms-with-7th-round-pick-Sean-Canfield/cce6a9ca-eaee-4878-ad40-0b98609f7fe7 因此,例如,如果以下链接是我的文章... http://www.neworleanssaints.com/news-and-events/article-1/Saints-agree-to-terms-with-7th-round-pick-Sean -Canfield / cce6a9ca-eaee-4878-ad40-0b98609f7fe7

Then how could I have the view focus on the article without the user having to zoom in and scroll the the top of the article. 然后,如何使视图集中于文章,而无需用户放大和滚动文章的顶部。 Thanks. 谢谢。

I think, you have to use an anchor, which are based on the ids of the HTML code. 我认为,您必须使用基于HTML代码ID的锚。 Then, you have to pass the Id you want to stick to after the url and a #. 然后,您必须在网址和#之后传递您要坚持的ID。 With your example, it would give something like that : http://www.neworleanssaints.com/news-and-events/article-1/Saints-agree-to-terms-with-7th-round-pick-Sean-Canfield/cce6a9ca-eaee-4878-ad40-0b98609f7fe7#c1256209263986 以您的示例为例,它会给出类似的信息: http : //www.neworleanssaints.com/news-and-events/article-1/Saints-agree-to-terms-with-7th-round-pick-Sean-Canfield / cce6a9ca-eaee-4878-ad40-0b98609f7fe7#c1256209263986

As the div you are looking for has an id (lucky you cause they don't have all the time) <div id="c1256209263986" class="iw_component"><div xmlns:esi="http://www.edge-delivery.org 作为div,您要查找的是一个ID(很幸运,因为他们没有所有时间) <div id="c1256209263986" class="iw_component"><div xmlns:esi="http://www.edge-delivery.org

Hope this will help you (Try to click on the link I put, this should open the page at the start of the article.) I never tried that but have a go a this, and come back to tell me if it worked. 希望这会对您有所帮助(尝试单击我放置的链接,这应该在文章开始时打开页面。)我从没有尝试过,但是尝试了一下,然后再次告诉我是否可行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM