Bild in zufälliger Größe in eine UIWebview (IOS) einpassen

Ich möchte ein großes Bild in UIwebview einfügen und dabei das Bildverhältnis wie in der Bildansicht beibehalten.

Wie kann ich es tun.

Mein Code passt wie folgt auf das Bild in Uiwebview. Wenn das Bild groß ist, ist die Anzeige nicht gut.

                CGFloat screenWidth = self.view.frame.size.width;
                CGFloat screenHeight = self.view.frame.size.height;

                NSString *htmlString = [NSString stringWithFormat:@"%@", @"<html><head><meta name='viewport' content='user-scalable=yes,width=device-width'></head><body bgcolor='000000'><img src='%@' width='%f' height='%f' style='max-width:200% max-height:200%'></body></html>"];
                imageHTML  = [[NSString alloc] initWithFormat:htmlString, fileUrl, screenWidth, screenHeight];

        [Webview loadHTMLString:imageHTML baseURL:nil];
        [imageHTML release];

Antworten auf die Frage(4)

Ihre Antwort auf die Frage