Fit image of random size into a UIWebview (IOS)

后端 未结 4 661
名媛妹妹
名媛妹妹 2020-12-10 08:26

\"\"

I want to fit large image into UIwebview with keeping image ratio same as image view.

How can i do

4条回答
  •  轮回少年
    2020-12-10 09:04

    The following code snippet may help you

    NSString *fontString = @"\
        \
        "];
        fontString = [[fontString stringByAppendingString:htmlString] stringByAppendingString:@""];
        [webView loadHTMLString:fontString baseURL:nil];
    

    The above code will resize the width and height of the image according to view dimension. You can change according to your requirement.

提交回复
热议问题