ios UIWebView 关于字体放大的问题

雯雯love 发布于 2013/12/19 14:14
阅读 956
收藏 0

下面是一段 P  标签

<P><FONT style=\"FONT-FAMILY: Comic Sans MS; FONT-SIZE: 16pt\"><STRONG>The Ten Digits</STRONG></FONT></P>
\n<P><FONT style=\"FONT-FAMILY: Times New Roman; FONT-SIZE: 10.5pt\">The Digits we use today are called \"Hindu-Arabic Numerals\" and look like these:<BR style=\"FONT-FAMILY: \">0&nbsp;&nbsp; 1&nbsp;&nbsp; 2&nbsp;&nbsp; 3&nbsp;&nbsp; 4&nbsp;&nbsp; 5&nbsp;&nbsp; 6&nbsp;&nbsp; 7&nbsp;&nbsp; 8&nbsp;&nbsp; 9<BR style=\"FONT-FAMILY: \">You can use these on their own to count up to 9.</FONT></P>
\n<P><FONT style=\"FONT-FAMILY: Comic Sans MS; FONT-SIZE: 16pt\"><STRONG>Ten Or More ...</STRONG></FONT></P>
\n<P><FONT style=\"FONT-FAMILY: Times New Roman; FONT-SIZE: 10.5pt\">When we have more than 9 items, we start another column - the \"tens\" column - and we write down how many \"tens\" we have, followed by how many ones (called \"units\"):</FONT></P>
\n<P><IMG border=0 src=\"/01_questions/XinPop_Web_CMS_editor/uploadfile/20131010161035471.jpg\"></P>
\n<P><FONT style=\"FONT-FAMILY: Times New Roman; FONT-SIZE: 10.5pt\">So we know that we have 1 Ten and 2 Ones, which makes 12.</FONT></P>
\n<P><FONT style=\"FONT-FAMILY: Comic Sans MS; FONT-SIZE: 16pt\"><STRONG>A Hundred Or More ...</STRONG></FONT></P>
\n<P><FONT style=\"FONT-FAMILY: Times New Roman; FONT-SIZE: 10.5pt\">When we have more than 99 items, we start another column - the \"hundreds\" column. Now we need to show how many hundreds, tens and units:</FONT></P>
\n<P><IMG border=0 src=\"/01_questions/XinPop_Web_CMS_editor/uploadfile/20131010160610365.jpg\"></P>
\n<P><FONT style=\"FONT-FAMILY: Times New Roman; FONT-SIZE: 10.5pt\">So we know that we have 1 Hundred, 4 Tens and 3 Ones.</FONT></P>
\n<P><FONT style=\"FONT-FAMILY: Comic Sans MS; FONT-SIZE: 16pt\"><STRONG>Zero</STRONG></FONT></P>
\n<P><FONT style=\"FONT-FAMILY: Times New Roman; FONT-SIZE: 10.5pt\">What if we have 1 Ten, but no Units? We show that we have no units by using a zero there:</FONT></P>
\n<P><IMG border=0 src=\"/01_questions/XinPop_Web_CMS_editor/uploadfile/20131010162006733.jpg\"></P>
\n<P><FONT style=\"FONT-FAMILY: Times New Roman; FONT-SIZE: 10.5pt\">We have to put a zero, or \"10\" would look like \"1\".<BR style=\"FONT-FAMILY: \">We use the same thing to show zero tens, hundreds, etc<BR style=\"FONT-FAMILY: \"><STRONG><FONT style=\"FONT-FAMILY: Times New Roman\">Example:</FONT> </STRONG>\"203\" means 2 Hundreds, Zero Tens and 3 Units.</FONT></P>
\n<P>&nbsp;</P>

这是我写的那段代码使webView内容放大,为何没有运行,还是因为这段P标签的代码本就有字体设置问题,还是因为我查找的标签有问题?

- (void)webViewDidFinishLoad:(UIWebView *)webView
{
    NSString *str1 = [NSString stringWithFormat:@"document.getElementsByTagName('P')[0].style.webkitTextSizeAdjust = '%f%%'",100.0];
    [contentWebView stringByEvaluatingJavaScriptFromString:str1];
}

求求各位帮帮忙,多谢


加载中
返回顶部
顶部