iOS:如何绘制沿 UIBezierPath 弯曲的文本? [英] iOS: How to draw text curving along a UIBezierPath?

查看:55
本文介绍了iOS:如何绘制沿 UIBezierPath 弯曲的文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要以编程方式绘制这样的东西:-


(来源:planetclegg.com)

除了我的 UIBezierPath 是关闭的 &我需要在跟随曲线时将文本放入其中.我的路径绘制正确,问题是文本.我在网上搜索并阅读了一堆教程,但似乎没有任何解决方案.这在 iOS 中是可能的,如果是,它是如何完成的?相关教程和/或代码片段的链接将不胜感激.

解决方案

您可以在我的 GithubArcText.

I need to programmatically draw something like this:-


(source: planetclegg.com)

Except that my UIBezierPath is closed & I need the text to fit inside it while following the curve. I have my path drawing correctly, the problem is the text. I've searched the 'net and read a bunch of tutorials but nothing seems to provide a solution. Is this possible in iOS, and if so how is it done? Links to relevant tutorials and/or code snippets would be much appreciated.

解决方案

You can see the sample code in my Github, the ArcText.

这篇关于iOS:如何绘制沿 UIBezierPath 弯曲的文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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