iOS UIWebView加载HTML标签 适配字体,图片和文字大小

/**
 HTML 适配图片文字

 @param htmlStr <#htmlStr description#>
 @return <#return value description#>
 */
- (NSString *)getHtmlString:(NSString *)htmlStr
{
    NSMutableString * html = [NSMutableString string];
    
    [html appendString:@""];
    [html appendString:@""];
    [html appendString : @"" ];
    
    [html appendString : @"" ];
        [html appendString : @"" ];
    [html appendString : @"" ];
    [html appendString : @"" ];
    
    //适配图片宽度,如果图片宽度超过手机屏幕宽度,就让图片宽度等于手机屏幕宽度,高度自适应,如果图片宽度小于屏幕宽度,就显示图片大小
    [html appendString : @"\n"];
    [html appendString : @"" ];
    
    [html appendString:@""];
    [html appendString:@""];
    [html appendString:htmlStr];
    [html appendString:@"
"]; [html appendString:@"
"]; [html appendString:@""]; [html appendString:@""]; return html; }

你可能感兴趣的:(iOS UIWebView加载HTML标签 适配字体,图片和文字大小)