美文网首页
Webview放入到Listview的headerview中显示

Webview放入到Listview的headerview中显示

作者: Ready_I | 来源:发表于2018-02-02 17:37 被阅读0次

网上见有好多说加什么webview的设置,或者写的固定值,但是这并不是想要的结果。
想要实现的结果大概就像今日头条的新闻详情界面。上面是一个webview ,下面是listview,item是评论内容。
用scrollview去嵌套一个webview和一个listview是行不通。
还是想着怎么把webview放入到listview的header中。
之前一直用的是
webView.loadUrl(url);
这样直接是加载的网页链接,就算html界面中设置的有自适应的高度,但是这种软加载有延迟,你的listview的header界面已经绘制好了,但是webview还没有加载完成。会造成界面只有一条。
最后想起之前的项目,用的是
webView.loadDataWithBaseURL(null, Base64Utils.base64Decode(o.getBody()), "text/html", "utf-8", null);
让返回的数据加上标签,进行base64加密过后传过来,好像数据不进行base64加密,无法把html的<head>标签等传递过来。
<head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> <style> *{white-space: normal !important;} img{width:100%;max-width:100%; height:auto;} </style> </head><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; white-space: normal;">方法<br style="box-sizing: border-box;"/></p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; white-space: normal;">1.系松紧带法此法安全方便即将尿布折成适合的长方形,根据晏几胖瘦而定。先将松紧带缝制成适宜的圆_带套在腰部,将婴儿被盖拉开,解开被污湿的尿布,用一手握住嬰儿两脚轻轻提起,露出臀部。另一手用尿布洁静的上端擦净会阴及臀部,取下污湿尿布•将污湿部分卷折在里面,放入尿布盆。如屁股污染大便,用温水洗净,并擦干,撤粉。再握住婴儿两脚并提起,使臀部提离,垫上干净尿布(男婴阴茎头向下,以免尿流入脐部•女嬰尿布下端稍厚可吸尿),拉平衣服,包好被子,<br style="box-sizing: border-box;"/></p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; white-space: normal;"><br style="box-sizing: border-box;"/></p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; white-space: normal;">此法应注意:尿布的长短松紧要适宜,过短过紧,易擦伤外生殖器,过长过松大便小便易溢出,更换时动作要轻柔迅速,避免受凉。</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; white-space: normal;">2.垫尿布法如果婴儿有红臀或臀部有伤口不宜紧兜尿布的婴儿用此法,使婴儿仰卧侧卧,将尿布折窄,前端,稍厚,夹在会阴处,尽量暴露臂部•前端固定在松紧带下</p><p><br/></p>
如果觉得返回的数据格式有问题,可以用这个html进行测试

相关文章

网友评论

      本文标题:Webview放入到Listview的headerview中显示

      本文链接:https://www.haomeiwen.com/subject/jxvezxtx.html