处理webview英文单词和数字不换行问题
`
import "NSString+Extension.h"
@implementation NSString (Extension)
- (NSString *)wkWebViewReplaceANewline {
NSString *content = @"<html><header><style type=\"text/css\"> body {word-wrap:break-word;}</style></header>";
NSString *tempContent = [[NSString alloc] initWithFormat:@"%@%@</html>",content,self];
return tempContent;}@end
`
使用
`
NSString *content = @"html代码999999999999999";
NSString *temp = content.wkWebViewReplaceANewline;
`
网友评论