UIView没有缩放到iPad视网膜 [英] UIView not scaling to iPad retina

查看:109
本文介绍了UIView没有缩放到iPad视网膜的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在更新我的应用程序以使用iPad视网膜显示器,但出于某种原因,我的一个观点不想扩展到2倍。正如您在屏幕截图中看到的那样,左侧按钮上的文本正确缩放,而右侧的文本仍以低分辨率显示字体。 (灰色的bg仍然很低,但我正在努力)。

I'm updating my app to work with the iPad retina display, but for some reason one of my views doesn't want to scale to 2x. As you can see in the screenshot, the text on the button on the left scales properly, while the text on the right still display the fonts in low resolution. (The gray bg is still low res, but I'm working on that).

我正在将ViewControllers正确地添加为主控制器的子节点,并且视图也遵循相同的层次结构。

I'm adding the ViewControllers as children of the main controller correctly, and the views also follow the same hierarchy.

谢谢!

推荐答案

我发现了问题所在。由于某种原因,未在子视图中正确设置contentScaleFactor。手动设置可以解决问题:

I figured out the problem. For some reason the contentScaleFactor is not being set properly in the subview. Setting it manually did the trick:

self.reportsController.view.contentScaleFactor = [UIScreen mainScreen].scale;

这篇关于UIView没有缩放到iPad视网膜的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆