0

I've got a question concerning a UIWebView in iPhone app (not a universal iPhone/iPad) displayed on an iPad. There are some ways to treat the application as a iPhone retina app (960x640), however I can't fing the way to display the UIWebView on the iPad in the same way as it's displayed on iPhone. The whole view and the fonts are blurred, because UIWebView thinks it's not a retina display.

Is there a way to make it think that it's retina display and to render a 960x640 instead of 480x320 scaled up?

UIWebView contentScaleFactor property is not changing anything. The site works perfectly on iPhone 4, with proper fonts and retina images. If I set the UIWebView frame as (0, 0, 960, 640) and scale it down then all content on the site is scaled down as well so that's not the proper way I think.

Edit: As a content I'm loading a local site, which is perfectly displayed on iPhone/iPhone (retina):

Body setion of a html:

(...)
<body>
    <h1>Header</h1>
    <p>Some paragraphs</p>
    <img src="image.png" width=250px height=200px/>     
</body>
(...)

Style.css:

body 
{
    width:400px;
    height:100%;
}

Edit2: Here is the link to screenshot of what am I getting - on the iPad, the iPhone retina UIWebView is displayed like on the iPhone and scaled up twice, what gives blurred result.

4

1 回答 1

0

不,当您按下 2x 按钮时,您的应用程序会按比例放大,而您无法在代码中检测到这一点。

这对 Apple 来说是一个很大的失误,当应用程序在 iPad 上以 2x 模式显示时,它应该在视网膜模式下运行,但这意味着你需要在应用程序进入 2x 模式时重新启动它。

您的应用程序的 Retina 版本将用于新 iPad,但此处的 agin 缩放只会使像素翻倍。

于 2012-08-30T13:34:26.767 回答