SwiftUI iOS 精品工具条组件之 13 多行文本支持换行滚动工具条(教程含源码)
作者:互联网
实战需求
SwiftUI iOS 精品工具条组件之 13 多行文本支持换行滚动工具条(教程含源码)
本文价值与收获
看完本文后,您将能够作出下面的界面
看完本文您将掌握的技能
- 点击实现切换
- 支持左右滚动
- 点击某个位置实现自动切换
实战代码
1、主界面
import SwiftUI
import JXSegmentedView
struct ContentView: View {
@State var selectIndex = -1
//@State var titles = ["关注", "推荐", "热榜","抗疫","要闻","新时代","视频","热点"]
@State var titles = ["综合", "最新", "读书","文学","职场","诗词散文","人生感悟","时尚"]
var body:
标签:13,滚动,工具条,State,源码,SwiftUI,var 来源: https://blog.csdn.net/iCloudEnd/article/details/113827761