gpt4 book ai didi

swiftui - swiftui 列表部分中的圆角

转载 作者:行者123 更新时间:2023-12-04 11:08:23 50 4
gpt4 key购买 nike

这是 iOS 13 Health 应用程序的屏幕截图 - 用户个人资料。我最近开始使用 并想知道如何开发如下所示的屏幕。我尝试了简单和分组的列表样式。但我无法看到下面的布局。

这样的UI可以纯粹用开发吗? ?

我特别在寻找圆形部分并在列表中包含一个图像。
iOS 13 Health Application - User profile

最佳答案

从 iOS 14 开始,您可以使用以下代码。它工作得非常完美,就像在 UIKit 中一样。

List {
Section {
Text("Item 1")
Text("Item 2")
Text("Item 3")
}

Section {
Text("Item 4")
Text("Item 5")
Text("Item 6")
}
}.listStyle(InsetGroupedListStyle()) // this has been renamed in iOS 14.*, as mentioned by @Elijah Yap
.environment(\.horizontalSizeClass, .regular)
谢谢你。

关于swiftui - swiftui 列表部分中的圆角,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57945907/

50 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com