You can use some of the string drawing methods to find out how large a frame you need for each tag, and then size a bunch of UILabels to fit each word.
As you'll likely want your user to interact with the tags, subclass UILabel to handle touches where appropriate.
发布评论
评论(1)
您可以使用一些字符串绘制方法来找出每个标签需要多大的框架,然后调整一堆 UILabel 的大小以适合每个单词。
由于您可能希望用户与标签进行交互,因此可以对 UILabel 进行子类化以在适当的情况下处理触摸。
You can use some of the string drawing methods to find out how large a frame you need for each tag, and then size a bunch of UILabels to fit each word.
As you'll likely want your user to interact with the tags, subclass UILabel to handle touches where appropriate.