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 も使用しましたが、適切なフォーマットが得られません。