我正在开发一个新闻应用程序。Webservice 向我返回一个 HTML 代码字符串。这是一篇文章的内容:
String result;
// result is returned from Webservice
result = "<p>Simply put, the 2013 Billboard Music Awards included a sizable helping of Bieber, with two performances in three hours and a Top Male Artist win before the Milestone Award was presented. Three months after another Justin -- Mr. Timberlake -- kept popping up at the 2013 Grammys and threatened overexposure, perhaps the audience at the Billboard Music Awards simply tired of seeing Bieber show up on stage and snag more of the spotlight.<br/><img align=\"Middle\" alt=\"\" border=\"0\" class=\"oImage\" height=\"335\" src=\"http://img2.news.zing.vn/2013/05/22/u2.jpg\" width=\"500\" \\/><br/>Plus, in the middle of the perceived mayhem was a monster-selling tour, with tons of Beliebers blissfully taking in the spectacle. But a dark cloud seemed embedded within the scraps of news coming from Bieber's tour over the past few months, and the Billboard Music Award boos could have been festering ill will toward one, some or all of them.<br/><img align=\"Middle\" alt=\"\" border=\"0\" class=\"oImage\" height=\"289\" src=\"http://img2.news.zing.vn/2013/05/22/u1.jpg\" width=\"500\"/></p>";
如您所见,“结果”中有 2 个图片网址。“结果”是整篇文章的内容。
当我使用 TextView 查看本文的内容时,图像不显示:
TextView content = (TextView) findViewById(R.id.tvContent);
content.setText(Html.fromHtml(result));
我怎样才能显示这篇文章的内容适合屏幕并显示所有图像。这是我的代码。
感谢您的帮助。