我从网上获取一个html字符串,然后使用Html.fromHtml对其进行格式化。现在我想检查第一个< / p>标签和< / p>在最后一个之前。
我真正想做的是在这些< / p>
之后插入我自己的小部件(例如ImageView)请你知道我怎么做吗?
<h4>Headinf heading</h4>
<p>An an valley indeed so no wonder future nature vanity. Debating all she mistaken indulged believed provided declared. Hcted expression favourable any. Unknown chiefly showing to conduct no. Hung as love evil able to post at as.</p>
<p>Indulgence announcing <strong>uncommonly met she continuing two</strong> unpleasing terminated. Now busy say down the shed eyes roof paid her. Of shameless collected suspicion existence in. Share walls stuff think but the arise guest. Course suffer to do he sussex .</p>
<img src="http://example.com/imahe.png"/>
<p>AWhether at dearest certain spirits is entered in to. Rich fine bred real use too many good. She compliment unaffected expression favourable any. Unknown chiefly showing to conduct no. Hung as love evil able to post at as.</p>
<blockquote>Indulgence announcing <strong>uncommonly met she continuing two</strong> matter enable misery end extent common men should. Her indulgence but assistance favourable cultivated everything collecting.</blockquote>
<img src="http://example.com/imahe.png"/>
<p>Indulgence announcing <strong>uncommonly met she continuing two</strong> end extent common men should. Her indulgence but assistance favourable cultivated everything collecting.</p>
<p>An an valley indeed so no wonder future nature vanity. Unknown chiefly showing to conduct no. Hung as love evil able to post at as.</p>
答案 0 :(得分:0)
您可以在每个关闭的段落标记之后插入自己的div,而不是检查“第一个</p>
标记和最后一个</p>
”,并将它们分配给它们类?然后,您可以引用这些类并在这些div中插入您的小部件。