为什么我的文字在我的 ios 应用程序中看起来如此糟糕?
我有一个 uiscrollview,它有一个包含文本和图像的自定义子视图。 文本项是 UILabels。我已附上代表质量问题的图像:
你们认为值得一试吗文本,然后转换为 uiimage 并显示它?也许它会更好地扩展?或者也许有一种方法可以平滑文本?
I have a uiscrollview that has a custom child view that contains text and images.
The text items are UILabels. I have attached an image representing the quality issue:
Do you guys think it might be worth a shot to draw the text, then convert to a uiimage and display that instead? Maybe it would scale better? Or perhaps there is a way to smooth the text?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
没有理由期望您绘制的文本会比
UILabel
更好。您的图片很难辨认,但这就是您想要查看的内容:UILabel
添加到UIScrollView
的contentView
>,或者你正在做其他更奇特的事情。 “其他更奇特的东西”很容易成为问题。UILabel
的origin
是整数(而不是分数)。在视网膜显示屏上,您可以使用半点,但通常将所有内容都设为整数会更容易。There's no reason to expect that you're going to draw the text better than
UILabel
does. Your picture is very hard to make out, but here's what you want to look at:UILabel
to theUIScrollView
'scontentView
, or are you doing something else fancier. That "something else fancier" could easily be the problem.origin
of yourUILabel
is integral (not a fraction). On a retina display, you can get away with half-points, but it's usually easier just to make everything integers.我认为这是立场问题。我打赌您将 x 或 y 值设置为浮点值,例如 12.3 或 12.5 。
I thinks it is the position issue. I bet you set the x or y value to float value like 12.3 or 12.5 .
我现在所做的是我创建了文本的 uiimage 版本,并展示了现在的质量比 uilabel 好得多,当你在 ipad 上放大查看它时,你真的可以看到差异,它必须比文本更好地缩放图像吗?
之前:
之后:
上面的图像显示了在更改之前和之后,文本在我的应用程序按比例放大的情况下在 ipad 上呈现的情况。
What I have done now is I have created a uiimage version of my text and am showing that now instead of the uilabels, the quality is soo much better, you can really see the difference when you are looking at it scaled up on the ipad, it must just do a better job scaling images then text?
Before:
After:
The above images show how the text renders on the ipad with my app scaled up, before and after my change.