UIScrollView 内的核心文本段落模糊
我尝试在 UIScrollView 内的视图中绘制一个长段落作为 NSAttributedString 。奇怪的是,段落的顶部并不模糊,但我滚动到底部越多,它就越模糊!我很清楚 Quartz 和 float 可能会遇到的小问题,因此我尝试将视图的框架设置为低于 0.5 点。现在我的段落顶部很模糊,底部还可以(!)我真的不知道如何解决这个问题,非常感谢任何帮助!
谢谢 !
I tried drawing a long paragraph as an NSAttributedString in a view inside a UIScrollView. Weird thing is, the top of the paragraph is not blurry, but the more I scroll to the bottom the blurrier it gets ! I am well aware of the small issues you can have with Quartz and floats, therefore I tried to set the frame of the view 0.5 points below. Now the top of my paragraph is blurry, and the bottom is OK (!) I really don't know how to fix this, and would appreciate any help !
Thank you !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我遇到的模糊文本的每个问题始终与将文本定位在子像素偏移处有关。在某个地方,您的位置可能不是整数,您应该将其向上或向下舍入。您可能想要检查的地方:
UIScrollView
的位置drawRect
的视图的位置我意识到这个问题已经有几个月了,但是无论如何得到一个答案都会很有用!
Every problem I've had to do with blurry text has always been to do with positioning the text at a sub-pixel offset. Somewhere, you probably have a position that isn't a whole number, and you should round it up or down. Places you might want to check:
UIScrollView
drawRect
inI realise that this question is a few months old, but though it would be useful to have an answer anyway!