3

So I basically get an NSData of UIImage and I use a UIWebView to display it. I do it that way:

[self.view addSubview:webView];

webView.delegate = self;
webView.scalesPageToFit = YES;
webView.backgroundColor = [UIColor darkGrayColor];

I then load the picture into it like this:

NSData *image02Data = attachmentToLoad.attachment_data;
[webView loadData:image02Data MIMEType:@"image/jpg" textEncodingName:nil baseURL:nil];

And I get a result that isn't exactly what I want:

enter image description here

As you can see the image leaves a white bottom line down at the bottom of the UIWebView. How can I make the size of the UIWebView to be equal to that of the image?

Community
  • 1
  • 1
Sergey Grischyov
  • 11,995
  • 20
  • 81
  • 120

1 Answers1

1

Have you seen this post? Click me

I think it is exactly you want

Community
  • 1
  • 1
Arthur
  • 1,740
  • 3
  • 16
  • 36