How can I make tag list in Swift?(如何在 Swift 中制作标签列表?)
问题描述
我想创建一个标签列表,我将从一个数组中获取什么,但我怎样才能将其风格化为:
在气泡内,如果行已满,则自动放置在下一行.有什么建议或想法吗?
请阅读这个库链接,它在下面给出了很棒的自定义标签设计,你需要为你的设计提供所有的东西.
<块引用>https://github.com/ElaWorkshop/TagListView
这里是如何使用它.
- 添加它的 cocoapods [pod "TagListView"].
- 创建一个您想在其上显示您选择的标签并对其进行约束的视图.
- 将您的视图类名称更改为TagListView".
- 在 viewDidLoad() 上设置委托.[yourView.delegate = self]
- 现在你可以使用它了.例如.
<块引用>
yourView.addTag("标签上的名称")或 yourView.addTags(["Name on Tag First","Name on Tag second","Name on tag third",.....等等])
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
Here is how to use it.
- add its cocoapods [pod "TagListView"].
- Create a view on which you wanna to show your selected tags and constraint it.
- change your view class name to "TagListView".
- set delegate on viewDidLoad(). [yourView.delegate = self]
- now you use it. eg.
yourView.addTag("Name on Tag") or yourView.addTags(["Name on Tag First","Name on Tag second","Name on tag third",.....and so on])
这篇关于如何在 Swift 中制作标签列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 Swift 中制作标签列表?


- SetOnItemSelectedListener上的微调程序错误 2022-01-01
- Xcode 7.3 中带有 UILabel 的 UIStackView 2022-01-01
- 网上有没有好的 UIScrollView 教程? 2022-01-01
- URL编码Swift iOS 2022-01-01
- UITextView 内容插图 2022-01-01
- 如何在 iPhone 模拟器中重置 NSUserDefaults 数据? 2022-01-01
- GPS状态的广播接收器? 2022-01-01
- 使用自动布局向 UIScrollView 添加动态大小的视图 2022-01-01
- 类似于 Mail.app 的 iPad 模态视图控制器? 2022-01-01
- 在 Iphone SDK 的导航栏上添加多个按钮 2022-01-01