Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/40.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/77.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.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
Iphone 如何在html代码中插入图像?_Iphone_Html_Css_Ios_Uiwebview - Fatal编程技术网

Iphone 如何在html代码中插入图像?

Iphone 如何在html代码中插入图像?,iphone,html,css,ios,uiwebview,Iphone,Html,Css,Ios,Uiwebview,我需要将背景图像添加到一个电话号码中,该电话号码包含在我加载到UIWebView的HTML代码中 NSString *stringToReplace = [NSString stringWithFormat:@"<a style=\"color:white; background-color:#707070; text-decoration:none\" href=\"compose://%@\">%@</a>",substring,substring]; new

我需要将背景图像添加到一个电话号码中,该电话号码包含在我加载到UIWebView的HTML代码中

NSString *stringToReplace = [NSString stringWithFormat:@"<a style=\"color:white; background-color:#707070; text-decoration:none\" href=\"compose://%@\">%@</a>",substring,substring];
    newString = [newString stringByReplacingOccurrencesOfString:substring withString:stringToReplace];
NSString*stringToReplace=[NSString stringWithFormat:@',子字符串,子字符串];
newString=[newString stringByReplacingOccurrencesOfString:substring with string:stringToReplace];
我已经设法改变了背景颜色,但我需要把一个图像作为背景。 其主要目标是在电话号码后面制作一个浅灰色的圆角背景

我发现了问题所在


谢谢,

我真的不理解你的代码,也许你应该使用:

background:#afdafd url('path…');
/*def.color。back.img.*/

我尝试添加这样的图像,但无法加载。我应该为图像指定什么路径?我只看到灰色背景,没有图像指向图像的路径。尝试在浏览器中打开图像并使用地址栏中的路径。这是一个iPhone应用程序,我尝试过放置路径,但没有显示图像。
background: #afdafd    url('path...');
          /*def.color. back.img.*/  

<a style=\"color:white; background:#707070 url('/images/rounded-corner.png'); text-decoration:none\" href=\"compose://%@\">%@</a>