如何在Swift中制作标签列表? [英] How can I make tag list in Swift?

查看:50
本文介绍了如何在Swift中制作标签列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个标签列表,该标签将从数组中获取,但是如何将其样式化为:

I want to create a list of tags, what I'll take from an array, but how can I stylize it as:

气泡内,如果行已满,则自动放置在下一行中.有提示或想法吗?

inside of bubbles and auto place in the next row if the line is full. Any tips or ideas?

推荐答案

请阅读此库链接,在其下方提供了很棒的自定义标签设计以及您设计所需的所有东西.

Please read this library link giving below it has awesome and custom tag design all the things you required for your design.

https://github.com/ElaWorkshop/TagListView

这里是使用方法.

  1. 添加其cocoapods [pod"TagListView"].
  2. 创建一个想要在其上显示所选标签并对其进行约束的视图.
  3. 将视图类名称更改为"TagListView".
  4. 在viewDidLoad()上设置委托.[yourView.delegate =自己]
  5. 现在使用它.例如.

yourView.addTag(标签上的名称")或yourView.addTags([[标记在第一个名称",标记在第二个名称",标记在第三个名称",.....依此类推])

yourView.addTag("Name on Tag") or yourView.addTags(["Name on Tag First","Name on Tag second","Name on tag third",.....and so on])

这篇关于如何在Swift中制作标签列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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