UIWebView:css 已忽略

UIWebView : css ignored

我是 objective C 的新手 我尝试将包含一些 html 和 css 的 NSString 传递给我的 webview :

[_webView loadHTMLString:htmlString baseURL:nil];

字符串:

@"<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\">\n<html>\n        <head>\n        <style type=\"text/css\">\n            

  body {\n                font-family: \"Gill sans\";\n                font-size: 12pt;\n                color: #808080;\n                margin: 0px;\n            }\n        
  a:link, a.visited, a:active {\n            font-style: normal;\n            color: #ffffff;\n            text-decoration: underline;\n        }\n        
  .accroche {\n            font-size: 19pt;\n            color: #ffffff;\n            text-align : center;\n        }\n        
  #title {\n            \n            text-transform : capitalize;\n        }\n        
</style>\n  

</head>\n    
<body>\n        
<div id=\"title\">Informations Utiles</div>\n        
<p><span class=\"accroche\"><p><a href=\"http://google.fr\">blablah</a>blablablah<br /> blabla<br />blabla <br />&nbsp;</p></span></p>\n    
</body>\n</html>\n"

对格式设置感到抱歉,但我不想对其进行过多更改,因为它可能会隐藏一些内容。 问题是,在模拟器的屏幕上,css 被忽略了,大写不起作用,文本对齐或字体大小,任何东西...

有什么想法吗?

我已经在 real device 上试过了,它可以正确呈现。这是一个 simulator 问题 :(

我正在使用 Xcode 4.3.2simulator 运行 iOS5.1.

我会将此问题作为 bugApple 一起提出,但希望这个答案将来能对其他人有所帮助!

希望对您有所帮助。