Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/120.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何更改UIWebnVIew iPhone的文本颜色_Ios_Webview - Fatal编程技术网

Ios 如何更改UIWebnVIew iPhone的文本颜色

Ios 如何更改UIWebnVIew iPhone的文本颜色,ios,webview,Ios,Webview,我正在使用webview加载html字符串。它加载了数据,但没有改变文本的颜色。我也在改变颜色,但没有效果 NSString *myDescriptionHTML = [NSString stringWithFormat:@"<html> \n" "<head> \n" "<style type=\"text/css\"> \n"

我正在使用webview加载html字符串。它加载了数据,但没有改变文本的颜色。我也在改变颜色,但没有效果

   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"

希望这会奏效