2012-03-04 14 views
0

我在一個UIWebView中顯示了一些HTML/css,這些HTML/css是用來顯示數據表的。爲什麼iOS 5上的UIWebView沒有將寬度應用到空​​元素

具體來說,問題是通過css在<td>元素上設置的寬度不適用於iPhone 4s上的空<td>單元格。它在iPad上工作,但不在我的iPhone 4s或iOS 5模擬器上工作?

我已經嘗試將生成的html/css從控制檯中直接複製到桌面上的文件中,並且它在桌面Safari和Firefox中也完美工作。

在我去之前的任何想法提交錯誤報告。

這裏是生成的CSS代碼:

[htmlPage appendString:@"<!DOCTYPE HTML><html><head><meta name=\"viewport\" content=\"initial-scale = 1.0\">\n"]; 
[htmlPage appendString:@"<style type=\"text/css\">"]; 
[htmlPage appendFormat:@"body {font-family:\"Courier New\"; font-size:14px; font-weight:bold; background-color:%@;}", cs.bgHTML]; 
[htmlPage appendString:@"table {margin:auto; border-collapse:collapse;}"]; 
[htmlPage appendFormat:@"th {padding-bottom:4px; color:%@;}", cs.labelHTML]; 
[htmlPage appendString:@".row-label {width:10px; padding-right:7px;}"]; 
[htmlPage appendFormat:@"td {padding:3px; border:1px solid %@; font-weight:bold; color:%@; text-align:center; width:45px; height:45px;}", cs.gridHTML, cs.aspectTextHTML]; 
[htmlPage appendFormat:@".glyphs {font-family:iPhemeris; color:%@; border:none;}", cs.labelHTML]; 
[htmlPage appendFormat:@"td .glyphs {color:%@;}", cs.aspectGlyphHTML]; 
[htmlPage appendString:@"</style></head><body>"]; 

回答

0

這個問題得到解決。關於<td>標籤沒有iOS錯誤。這個問題是由於使用Viewport中繼標記引起的,它使得iPhone上的顯示器發生偏斜....

相關問題