我有以下列表出现在菜单栏中,但列表出现在背景中,我希望它是透明的背景。
代码:
List(fetch.todos) { todo in
VStack(alignment: .leading, spacing: 0) {
Text(todo.title)
Text("\(todo.completed.description)")
.font(.system(size: 11))
.foregroundColor(Color.gray)
}
}
发布于 2020-08-25 20:47:23
可以将.listStyle(SidebarListStyle())
修改器添加到List
视图中,使其与系统的透明度相匹配。
https://stackoverflow.com/questions/63584100
复制相似问题