【发布时间】:2015-01-17 12:11:05
【问题描述】:
我正在使用字符串请求加载UIWebView。在我的 html 字符串中,我有 iframe 标签,其中它的宽度值比预期的要大得多。如何更改该值?
我的 html 字符串 -
<html>
<head>
<style type="text/css">
body {font-family:"Helvetica"; font-size: 18;} img {max-width: 100%; width: 100%; height: 100%};
</style>
</head>
<body><p><span style="font-size: 13px; line-height: 1.6em;">***Some Text***.</span></p>
<p>***Some Text***.</p>
<p><iframe allowfullscreen="" frameborder="0" height="360" src="//www.some-domain.com/embed/mwOFWJUOpv8" width="600"></iframe></p></body>
如您所见,iframe 标签中的 width=600 导致 iPhone 出现问题。我该如何改变呢?
我已经通过以下代码管理图像,我想管理iframe。
目前已实现的代码 -
NSString *str = [NSString stringWithFormat:@"<html> \n"
"<head> \n"
"<style type=\"text/css\"> \n"
"body {font-family:\"%@\"; font-size: %@;} img {max-width: 100%%; width: 100%%; height: 100%%};\n"
"</style> \n"
"</head> \n"
"<body>%@</body> \n"
"</html>", @"Helvetica", [NSNumber numberWithInt:iWebViwFontSize], strHtml];
webViwNewsDescription loadHTMLString:str baseURL:baseURL];
【问题讨论】:
标签: html ios css iframe uiwebview