3
所以我基本上得到了NSData
的UIImage
,我用UIWebView
來顯示它。我這樣做的:在UIWebView中載入UIImage格式的NSData,並居中它
[self.view addSubview:webView];
webView.delegate = self;
webView.scalesPageToFit = YES;
webView.backgroundColor = [UIColor darkGrayColor];
然後我的圖片加載到這樣的:
NSData *image02Data = attachmentToLoad.attachment_data;
[webView loadData:image02Data MIMEType:@"image/jpg" textEncodingName:nil baseURL:nil];
而我得到的結果是不正是我想要的:
正如您所看到的圖像在UIWebView
的底部留下白底。我怎樣才能使UIWebView
的大小與圖像的大小相等?
真棒,謝謝! – 2013-03-21 10:16:01