安卓设备或电视设备加载html文件后,显示不全

福尔摩斯对我笑 2019-05-14 28340 次 2639条

最近项目中使用安卓的webview控件将html文件加载到电视和win的设备上,经过测试,发现在一张1920*1080的html文件,在win上可以正常显示,在电视屏幕上显示不全

问题排查

  • 安卓是否设置为自动适应屏幕,是否支持缩放,然而设置后发现还是不正常,继续
//适应屏幕
webView.getSettings().setUseWideViewPort(true);
webView.getSettings().setLoadWithOverviewMode(true);


webView.setVisibility(View.VISIBLE);
webView.setBackgroundColor(0);
webView.getSettings().setAllowFileAccess(true);// 设置允许访问文件数据webView.getSettings().setSupportZoom(true);//支持放大网页功能webView.getSettings().setBuiltInZoomControls(true);//支持缩小网页功能


  • 查看html页面中是否设置meta标签,经查证设置了该标签,并支持缩放,然而还是不行

<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />

  • 后来去掉了meta标签后,竟然正常了,所有设备测试通过.

原因如下:meta viewport 标签之前,layout viewport 宽度是浏览器默认的(大部分浏览器、WebView都默认为这个值)。meta viewport 标签之后,因为指定了 initial-scale=1,所以浏览器将 layout viewport 宽度设为 visual viewport(可视区域) 的宽度,其它一系列的 width 也跟风进行变动。

https://landchanning.github.io/2018/01/25/webview_viewport/

具体关于viewport的说明请查看 https://www.cnblogs.com/2050/p/3877280.html

标签: 无

非特殊说明,本博所有文章均为博主原创。

头像也是LOGO
未来博客 博主大人
到了这个年纪,不应该再彷徨!

发表评论



 


已有 2639 条评论 1


  1. kd 11 shoes

    I’m commenting to let you be aware of of the notable encounter my friend’s girl undergone studying your webblog. She noticed several pieces, most notably how it is like to have an excellent teaching mood to let most people effortlessly know just exactly selected advanced subject matter. You undoubtedly exceeded our expectations. Thank you for showing such invaluable, healthy, educational and also fun tips on that topic to Evelyn.

    回复 2019年11月14日
  2. yeezy boost 350

    I am just writing to let you know what a exceptional encounter my friend’s daughter encountered viewing your web page. She noticed a lot of pieces, with the inclusion of how it is like to possess an awesome giving style to get the rest with no trouble have an understanding of specific advanced matters. You truly exceeded our own desires. Thank you for presenting the interesting, safe, revealing and also unique guidance on this topic to Ethel.

    回复 2019年11月13日
  3. russell westbrook shoes

    I wish to express appreciation to you just for bailing me out of this type of difficulty. Just after looking out throughout the search engines and seeing notions which are not powerful, I assumed my life was well over. Existing devoid of the approaches to the difficulties you’ve sorted out by way of your main report is a serious case, and those that could have adversely damaged my career if I had not discovered your website. Your own personal competence and kindness in maneuvering all the things was precious. I’m not sure what I would’ve done if I hadn’t discovered such a thing like this. I can also now look forward to my future. Thanks a lot very much for the reliable and sensible guide. I won’t hesitate to suggest your web site to anybody who requires guidelines about this area.

    回复 2019年11月13日
  4. supreme t shirt

    Thank you for all your valuable labor on this website. My mum takes pleasure in conducting investigations and it is easy to understand why. I learn all concerning the powerful mode you render reliable solutions via the website and therefore strongly encourage participation from others on that topic and our princess is in fact discovering so much. Take pleasure in the rest of the year. You have been carrying out a really great job.

    回复 2019年11月13日
  5. yeezy shoes

    I must express my admiration for your kind-heartedness for those individuals that absolutely need assistance with this question. Your real dedication to getting the solution all around had become incredibly functional and has in every case enabled ladies much like me to realize their objectives. Your entire informative instruction implies this much to me and still more to my colleagues. Thank you; from everyone of us.

    回复 2019年11月12日
  6. golden goose sneakers

    I actually wanted to write down a small word to appreciate you for those awesome techniques you are placing here. My rather long internet research has at the end been compensated with beneficial ideas to talk about with my close friends. I would repeat that we visitors actually are undeniably blessed to be in a useful network with many lovely people with insightful advice. I feel really grateful to have seen your webpages and look forward to tons of more entertaining minutes reading here. Thank you once more for all the details.

    回复 2019年11月11日
  7. adidas superstars

    Thank you a lot for providing individuals with an extremely remarkable opportunity to read critical reviews from this web site. It really is very sweet and stuffed with amusement for me and my office co-workers to search the blog more than thrice a week to read through the latest secrets you have got. Not to mention, we’re usually satisfied for the wonderful creative ideas you serve. Some 2 ideas on this page are in truth the very best we’ve had.

    回复 2019年11月11日
  8. ferragamo belt

    I have to voice my admiration for your kind-heartedness supporting those people who really want help on this particular concept. Your special dedication to getting the message along came to be pretty significant and has consistently enabled women like me to attain their objectives. The helpful instruction entails a great deal to me and still more to my office colleagues. Thank you; from each one of us.

    回复 2019年11月11日
  9. hermes belt

    I precisely wanted to say thanks yet again. I’m not certain the things I might have accomplished without the actual techniques discussed by you directly on such a subject matter. It seemed to be the difficult concern in my circumstances, however , viewing this skilled technique you processed it took me to leap with happiness. Now i’m happy for your information and as well , pray you know what an amazing job that you’re undertaking teaching many others using your websites. I am sure you’ve never encountered all of us.

    回复 2019年11月10日
  10. christian louboutin shoes

    Thank you for all your valuable effort on this web site. My mother really likes setting aside time for research and it’s really simple to grasp why. All of us notice all regarding the powerful form you convey sensible tips and hints by means of your web blog and as well as invigorate participation from the others on that subject plus our daughter is undoubtedly studying a lot of things. Have fun with the rest of the year. You’re carrying out a tremendous job.

    回复 2019年11月10日
  11. air jordan

    I and my guys have already been looking at the best recommendations from your web site and so quickly came up with an awful feeling I never expressed respect to the site owner for those tips. The young boys are already for that reason passionate to read through them and have clearly been enjoying those things. I appreciate you for simply being so thoughtful and also for pick out this sort of useful topics most people are really desirous to be aware of. My very own honest apologies for not saying thanks to you earlier.

    回复 2019年11月8日
  12. nike sneakers

    I simply wished to thank you very much once more. I’m not certain what I would have taken care of in the absence of those ideas revealed by you relating to such a problem. Previously it was the frightful crisis for me personally, however , witnessing the very professional way you solved it forced me to cry with gladness. I am just grateful for the guidance and thus have high hopes you comprehend what a great job you are undertaking teaching people using your site. More than likely you have never met any of us.

    回复 2019年11月7日
  13. jordan 11

    I actually wanted to post a simple word to thank you for those superb ways you are giving at this website. My considerable internet search has finally been compensated with good details to exchange with my family members. I ‘d assert that most of us website visitors actually are very much blessed to dwell in a fine site with very many perfect people with useful techniques. I feel pretty lucky to have used the web pages and look forward to some more thrilling moments reading here. Thank you again for a lot of things.

    回复 2019年11月5日
  14. moncler coat

    Thank you for every one of your hard work on this web site. My mom loves going through investigations and it’s obvious why. My partner and i know all regarding the compelling means you convey worthwhile tactics on the web blog and therefore welcome response from the others about this subject then my simple princess has been studying so much. Enjoy the remaining portion of the year. You’re performing a great job.

    回复 2019年11月2日
  15. louboutin shoes

    I would like to express some thanks to the writer for bailing me out of this particular condition. Right after researching throughout the world-wide-web and getting tips which are not pleasant, I believed my life was done. Being alive without the strategies to the difficulties you’ve fixed by means of your write-up is a serious case, as well as ones which might have badly affected my entire career if I hadn’t encountered your blog post. Your good training and kindness in taking care of the whole lot was very useful. I don’t know what I would have done if I hadn’t come upon such a subject like this. I can also now relish my future. Thank you very much for the specialized and sensible help. I will not hesitate to suggest your web site to any person who would need recommendations on this issue.

    回复 2019年11月2日
  16. cheap jordans

    I would like to show my gratitude for your kindness supporting those individuals that absolutely need assistance with that area. Your real commitment to getting the solution all over had been especially important and have constantly helped professionals just like me to arrive at their pursuits. Your warm and friendly guideline means a whole lot to me and somewhat more to my office workers. Thank you; from all of us.

    回复 2019年11月1日
  17. balenciaga shoes

    I not to mention my guys were actually examining the excellent hints on your web blog and instantly got a terrible suspicion I never expressed respect to the web blog owner for those tips. All the young men are already totally very interested to see them and have now without a doubt been taking pleasure in those things. Appreciate your getting really kind and then for using this form of very good subject matter most people are really eager to discover. My personal sincere apologies for not saying thanks to earlier.

    回复 2019年10月31日
  18. curry 5

    I actually wanted to develop a simple word to say thanks to you for all the magnificent tips you are writing here. My particularly long internet search has finally been honored with good facts and strategies to go over with my visitors. I would assert that most of us visitors are very endowed to exist in a wonderful website with very many wonderful people with great ideas. I feel really privileged to have come across your entire website page and look forward to many more pleasurable moments reading here. Thank you once more for everything.

    回复 2019年10月30日
  19. adidas stan smith

    My wife and i ended up being quite comfortable Jordan managed to conclude his researching through your ideas he discovered through your web site. It is now and again perplexing just to be giving freely things which other people could have been selling. And we consider we now have you to be grateful to for this. These explanations you’ve made, the simple site menu, the friendships you can help to foster – it’s got most fabulous, and it is making our son and our family understand the theme is thrilling, and that’s particularly important. Thank you for all the pieces!

    回复 2019年10月28日
  20. nike basketball shoes

    I definitely wanted to write down a quick remark to thank you for the lovely recommendations you are giving at this website. My time-consuming internet research has now been compensated with excellent knowledge to exchange with my colleagues. I ‘d mention that most of us site visitors are unquestionably lucky to live in a magnificent network with many marvellous people with insightful principles. I feel quite grateful to have encountered your entire webpage and look forward to tons of more thrilling moments reading here. Thanks again for a lot of things.

    回复 2019年10月25日
  21. cheap jordans

    A lot of thanks for your entire efforts on this website. Betty takes pleasure in managing investigation and it is simple to grasp why. All of us hear all relating to the lively manner you make worthwhile ideas on this web site and therefore attract contribution from the others on this concern while my child is certainly being taught so much. Have fun with the remaining portion of the new year. You have been carrying out a good job.

    回复 2019年10月24日
  22. golden goose

    I have to voice my admiration for your kind-heartedness giving support to individuals that have the need for guidance on this important area of interest. Your very own dedication to passing the solution all over appears to be wonderfully functional and has truly made professionals like me to attain their dreams. Your useful report denotes much a person like me and even more to my fellow workers. Thanks a ton; from all of us.

    回复 2019年10月23日
  23. christian louboutin outlet

    I and my guys appeared to be looking through the good strategies found on your web page and then developed an awful suspicion I had not thanked the web site owner for those techniques. All the young men became certainly excited to learn them and now have truly been using these things. Appreciate your really being quite thoughtful and also for obtaining this form of incredibly good things most people are really needing to learn about. Our own honest regret for not expressing gratitude to sooner.

    回复 2019年10月22日
  24. yeezy boost 350 v2

    I want to show thanks to the writer just for bailing me out of this crisis. As a result of exploring through the search engines and obtaining opinions which were not pleasant, I figured my entire life was gone. Living without the approaches to the issues you’ve resolved all through your main article content is a crucial case, and the kind which might have negatively affected my career if I had not noticed your web site. Your own know-how and kindness in handling all the stuff was useful. I am not sure what I would’ve done if I had not discovered such a stuff like this. I can now look forward to my future. Thanks a lot very much for your expert and sensible help. I won’t think twice to propose your web site to anyone who would need guide on this area.

    回复 2019年10月22日
  25. balenciaga shoes

    I want to convey my affection for your kind-heartedness giving support to women who require help on your content. Your personal commitment to getting the message all-around has been really insightful and has always enabled regular people just like me to reach their dreams. This warm and friendly publication entails so much to me and even more to my mates. Regards; from each one of us.

    回复 2019年10月21日
  26. nfl jerseys

    I needed to put you one bit of word to be able to say thanks once again for these exceptional tips you have documented on this website. It has been so extremely generous of people like you to make without restraint all that many individuals would’ve made available for an e book in making some bucks for themselves, mostly now that you might well have tried it if you considered necessary. Those suggestions also served to become good way to realize that someone else have the same passion really like my very own to know a little more on the topic of this issue. I know there are several more pleasant moments ahead for folks who read your blog post.

    回复 2019年10月20日
  27. nike air max 2017

    I enjoy you because of every one of your hard work on this blog. My niece really loves doing internet research and it’s easy to understand why. All of us know all relating to the dynamic form you produce both interesting and useful suggestions via your web blog and even encourage contribution from other individuals on the idea then our own princess is now understanding a lot. Take advantage of the remaining portion of the new year. You are performing a fabulous job.

    回复 2019年10月19日
  28. hermes birkin bag

    I wish to convey my love for your kindness in support of folks that need help with this particular concern. Your personal commitment to passing the solution throughout had become particularly invaluable and have surely enabled regular people much like me to get to their ambitions. Your personal helpful facts can mean a whole lot a person like me and much more to my mates. Thanks a ton; from all of us.

    回复 2019年10月18日
  29. christian louboutin shoes

    Thank you so much for giving everyone a very special possiblity to read critical reviews from here. It is always so pleasing and as well , full of amusement for me personally and my office fellow workers to search the blog really three times every week to study the latest secrets you have got. And definitely, I’m just at all times astounded with the spectacular tricks you give. Certain 1 points in this post are ultimately the most impressive I have ever had.

    回复 2019年10月17日
  30. kobe shoes

    I actually wanted to type a quick comment so as to express gratitude to you for all the fabulous ways you are posting here. My particularly long internet investigation has now been rewarded with reasonable information to exchange with my contacts. I ‘d repeat that many of us readers actually are really lucky to live in a decent website with so many brilliant people with insightful plans. I feel somewhat fortunate to have seen the web page and look forward to some more fun minutes reading here. Thanks a lot once again for everything.

    回复 2019年10月16日
  31. jordan shoes

    Thank you for all of your labor on this web site. My mother really likes carrying out investigation and it’s easy to see why. A number of us know all concerning the powerful tactic you create great strategies through this web site and as well increase contribution from other individuals on this content while our child is truly being taught so much. Enjoy the rest of the new year. You have been performing a superb job.

    回复 2019年10月15日
  32. golden goose outlet

    I intended to post you this little observation to finally thank you very much as before just for the remarkable knowledge you’ve documented on this page. This has been certainly remarkably generous with people like you to supply easily what a lot of people might have made available as an e-book to make some cash for themselves, principally considering that you might have tried it if you desired. The thoughts additionally acted as the great way to fully grasp that other people have the same fervor the same as my very own to find out much more in regard to this problem. I know there are some more enjoyable sessions up front for people who read your blog.

    回复 2019年10月14日
  33. nike air max 90

    My wife and i ended up being so thankful when Raymond could finish up his survey through your ideas he had out of the site. It’s not at all simplistic to simply choose to be releasing tips and tricks many others could have been making money from. Therefore we already know we have got you to thank for this. The specific illustrations you have made, the straightforward blog navigation, the relationships you can make it possible to promote – it’s got mostly powerful, and it’s really leading our son and the family know that this theme is satisfying, which is tremendously important. Many thanks for all the pieces!

    回复 2019年10月13日
  34. supreme clothing

    I precisely wanted to appreciate you all over again. I do not know the things that I might have gone through without the entire basics revealed by you concerning this subject. It actually was a real frightening case in my opinion, however , taking note of the specialised approach you treated it made me to jump with happiness. I’m happy for this work and expect you recognize what a powerful job you were undertaking instructing people today by way of your web site. I’m certain you haven’t encountered any of us.

    回复 2019年10月12日
  35. cheap jordans

    I precisely wished to appreciate you yet again. I’m not certain the things I could possibly have sorted out without the type of secrets provided by you on such theme. It became a depressing situation in my position, nevertheless coming across this professional tactic you treated the issue forced me to cry over delight. Extremely thankful for the support as well as have high hopes you are aware of an amazing job you’re accomplishing training the others with the aid of your webpage. Most probably you have never come across all of us.

    回复 2019年10月12日
  36. golden goose sneakers

    My wife and i felt now lucky that Albert could complete his investigations from your precious recommendations he discovered through your web page. It’s not at all simplistic just to always be freely giving guidelines which often the others may have been making money from. And we also realize we have got you to thank because of that. The specific explanations you made, the simple web site navigation, the friendships you will give support to create – it is mostly powerful, and it is assisting our son and our family do think this article is enjoyable, which is certainly rather essential. Thanks for all the pieces!

    回复 2019年10月11日
  37. air max 270

    I as well as my pals came studying the nice techniques on your web blog then instantly I got a horrible feeling I never thanked the site owner for those tips. All the men came totally passionate to see all of them and have now in truth been tapping into them. Appreciation for turning out to be quite helpful and then for obtaining varieties of fabulous guides most people are really eager to know about. Our own sincere apologies for not expressing appreciation to earlier.

    回复 2019年10月10日
  38. bape hoodie

    I wanted to send you one bit of word to be able to say thanks a lot as before for your lovely ideas you’ve contributed on this page. It was so seriously open-handed with you to offer unhampered what most of us would have offered as an e book to generate some bucks for their own end, particularly considering that you could have tried it if you decided. Those thoughts in addition served to provide a great way to be sure that many people have the identical dream just as my very own to realize significantly more with respect to this problem. I’m certain there are several more fun periods ahead for folks who read through your website.

    回复 2019年10月9日
  39. nike air vapormax

    I as well as my friends have already been analyzing the best advice located on your web site and then the sudden came up with a horrible feeling I never expressed respect to the blog owner for those tips. Those boys were definitely consequently warmed to see them and now have in reality been making the most of these things. I appreciate you for turning out to be quite considerate and also for deciding upon this kind of awesome topics millions of individuals are really eager to be informed on. My personal honest regret for not saying thanks to earlier.

    回复 2019年10月8日