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 中制作标签列表?
基础教程推荐
- 在 iOS 上默认是 char 签名还是 unsigned? 2022-01-01
- 如何使 UINavigationBar 背景透明? 2022-01-01
- LocationClient 与 LocationManager 2022-01-01
- Android文本颜色不会改变颜色 2022-01-01
- 固定小数的Android Money Input 2022-01-01
- :hover 状态不会在 iOS 上结束 2022-01-01
- 使用 Ryzen 处理器同时运行 WSL2 和 Android Studio 2022-01-01
- 如何使用 YouTube API V3? 2022-01-01
- Android ViewPager:在 ViewPager 中更新屏幕外但缓存的片段 2022-01-01
- “让"到底是怎么回事?关键字在 Swift 中的作用? 2022-01-01
