我正在制作一个应用程序,其中我从 web 服务获取一些 html 数据,并在 UIWebView 中显示该数据。我已经修复了 UIWebView "310" 的宽度,但有时数据没有出现在这个框架中,并且数据是从边缘剪掉的。我正在从网络接收这些数据 -
NSString *resul=@"<div align=\"left\">As stated Please give a chance to serve you.<br></div><div align=\"left\"><br></div><div align=\"left\"><div class=\"lc\" style=\"margin: 0px; font-size: 11px; font-family: Arial, Helvetica, sans; clear: left; float: left;
宽度:348px;text-align: center;\"><p style=\"text-align: justify; line-height: 14px; margin: 0px 0px 14px; padding: 0px;\"><strong>Lorem Ipsum</strong> is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p></div><div class=\"rc\" style=\"margin: 0px; font-size: 11px; font-family: Arial, Helvetica, sans; clear: right; float: right;
宽度:348px;text-align: center;\"><h2 class=\"why\" style=\"margin: 0px; padding: 0px; font-weight: normal; font-size: 12px; height: 26px; text-align: left; background-image: url(http://www.lipsum.com/images/en/heading.gif); background-position: 0px -52px; background-repeat: no-repeat no-repeat;\"></h2><p style=\"text-align: justify; line-height: 14px; margin: 0px 0px 14px; padding: 0px;\">It is a long ehat a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).</p></div></div>
"
我知道我从网上收到 348 码的原因。所以我想问一下如何根据我们的帧大小调整它的大小。我用过 -
webview.autoresizingMask = UIViewAutoresizingFlexibleWidth;
webview.scalesPageToFit = YES;
webview.autoresizesSubviews=YES;
但是数据显示的尺寸太小了。![数据显示在显示小][1]
我也使用了委托方法 webViewDidFinishLoad 但没有得到正确的格式。