Ios 调用HTML表时,iPhone字体未减少
在我的iPhone应用程序中,我使用HTML标记以表格格式显示数据,但我必须减少字体。这是我的密码Ios 调用HTML表时,iPhone字体未减少,ios,objective-c,iphone,fonts,html-table,Ios,Objective C,Iphone,Fonts,Html Table,在我的iPhone应用程序中,我使用HTML标记以表格格式显示数据,但我必须减少字体。这是我的密码 - (void) setStats:(NSArray*)stats { NSString * htmlString; if ( [UIHelper isPad] ) htmlString = @"<html><style type=\"text/css\">body{padding:15px 40px 0 40px; font-family: Helvetica;"
- (void) setStats:(NSArray*)stats {
NSString * htmlString;
if ( [UIHelper isPad] )
htmlString = @"<html><style type=\"text/css\">body{padding:15px 40px 0 40px; font-family: Helvetica;"
"font-size: 16px;"
"color: #888888"
"},</style><body><table cellpadding=4>";
else
htmlString = @"<html><style type=\"text/css\">body{padding:8px 20px 0 20px; font-family: Helvetica;"
"font-size: 11px;"
"color: #888888;"
"},</style><body><p align=\"left\">";
for ( NSDictionary *val in stats ) {
NSString *statTitle = [NSString stringWithFormat:@"%@", [val objectForKey:@"title"]];
NSString *statValue = [NSString stringWithFormat:@"%@", [val objectForKey:@"value"]];
NSString * str = [NSString stringWithFormat:@"<tr><td width=\"60%%\">%@</td><td width=\"40%%\">%@</td></tr>", statTitle, statValue];
htmlString = [NSString stringWithFormat:@"%@%@", htmlString, str];
}
htmlString = [NSString stringWithFormat:@"%@%@", htmlString, @"</table></body></html>"];
if ( [contentView respondsToSelector:@selector(loadHTMLString:baseURL:)] )
[contentView loadHTMLString:htmlString baseURL:[NSURL URLWithString:@"http://www.secondprizm.com"]];
}
-(void)setStats:(NSArray*)stats{
NSString*htmlString;
如果([UIHelper isPad])
htmlString=@“正文{填充:15px 40px 0 40px;字体系列:Helvetica
“字体大小:16px;”
“颜色:#888888”
"},";
其他的
htmlString=@“正文{填充:8px 20px 0 20px;字体系列:Helvetica
“字体大小:11px;”
“颜色:#888888;”
},;
用于(统计中的NSDictionary*val){
NSString*statTitle=[NSString stringWithFormat:@“%@,[val objectForKey:@“title]”;
NSString*statValue=[NSString stringWithFormat:@“%@,[val objectForKey:@“value”];
NSString*str=[NSString stringWithFormat:@“%@%@”,statitle,statValue];
htmlString=[NSString stringWithFormat:@“%@%@”,htmlString,str];
}
htmlString=[NSString stringWithFormat:@“%@%@”,htmlString,@”“;
if([contentView respondsToSelector:@selector(loadHTMLString:baseURL:)]))
[contentView loadHTMLString:htmlString baseURL:[NSURL URLWithString:@]http://www.secondprizm.com"]];
}
尝试此链接可能会对您有所帮助,您的问题中没有真正的HTML。为什么人们在问HTML问题时不发布HTML,而是发布某种(伪)代码?