Ios 如何更改UIWebnVIew iPhone的文本颜色
我正在使用webview加载html字符串。它加载了数据,但没有改变文本的颜色。我也在改变颜色,但没有效果Ios 如何更改UIWebnVIew iPhone的文本颜色,ios,webview,Ios,Webview,我正在使用webview加载html字符串。它加载了数据,但没有改变文本的颜色。我也在改变颜色,但没有效果 NSString *myDescriptionHTML = [NSString stringWithFormat:@"<html> \n" "<head> \n" "<style type=\"text/css\"> \n"
NSString *myDescriptionHTML = [NSString stringWithFormat:@"<html> \n"
"<head> \n"
"<style type=\"text/css\"> \n"
"body {font-family: \"%@\"; font-size: %@; text-colour:red}\n"
"</style> \n"
"</head> \n"
"<body>%@</body> \n"
"</html>", @"helvetica", [NSNumber numberWithInt:18], texts];
NSString*myDescriptionHTML=[NSString stringWithFormat:@“\n”
“\n”
“\n”
正文{字体系列:\“%@\”字体大小:%@;文本颜色:红色}\n
“\n”
“\n”
“%@\n”
“,@“helvetica”,[NSNumber Withint:18],文本];
它显示默认颜色,而不是给定的新颜色问题在CSS代码中,因此只需替换
"body {font-family: \"%@\"; font-size: %@; text-colour:red}\n"
与
希望这能起作用问题出在CSS代码中,因此只需替换
"body {font-family: \"%@\"; font-size: %@; text-colour:red}\n"
与
希望这能起作用问题出在CSS代码中,因此只需替换
"body {font-family: \"%@\"; font-size: %@; text-colour:red}\n"
与
希望这能起作用问题出在CSS代码中,因此只需替换
"body {font-family: \"%@\"; font-size: %@; text-colour:red}\n"
与
希望这会奏效