Quartz 2d / Core Graphics: What is the right way to draw some text?

女生的网名这么多〃 提交于 2019-12-04 05:22:35

#1 doesn't support international characters. So, don't use it if you use it to draw texts inputted by a user.

So, please use #2 unless you're absolutely sure that the text only contains standard ASCII characters.

#2 is how I generally do it unless I need the more precise control of using CG/CT

While I agree with Yuji that you should not use #1, I would add that if at all possible you should use a UILabel instead of custom drawing, because if you can avoid implementing -drawRect: at all, anywhere, you should.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!