开发者

iPad running iPhone apps and font scaling

I'm testing one of my iPhone apps on my iPad in "2x" mode, so it stretches everything to double-size. I've noticed that some text appears to be smoother than others. From my (limited) testing, text in a UITextVi开发者_如何学运维ew or UITextField that is being edited (has keyboard focus) is smoother than a plain UILabel hanging out in a view. I'm not sure if it's anti-aliasing in 2x2 pixel blocks still, or just that it uses all the pixels to draw the letters rather than treating them as 2x2 pixel blocks, or something else entirely. From my testing, this appears to be true regardless of font size.

Does anyone know what is going on here?

And, more importantly, is there a way to control this? It looks much better and I'd like to have my plain UILabels drawn this way too! I'm hoping that a future iOS update will allow the iPad to use iPhone 4 "@2x" resources and font drawing when running an iPhone app in 2x mode, that would make them look much better!

Thanks!


iPad's legacy scaling mode obeys CALayer's magnificationFilter property. Use kCAFilterLinear for smoothed/blurry upscaling, and kCAFilterNearest for blocky/crisp upscaling.

Also, if you set the contents property to be a CGImage that is double-sized, QuartzCore will gladly take advantage of the extra resolution.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜