Iphone 如何在html代码中插入图像?
我需要将背景图像添加到一个电话号码中,该电话号码包含在我加载到UIWebView的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
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>