qt中groupbox外观
SwiftUI groups were introduced with iOS 13. They act as containers for wrapping different view types and also let you work around the 10 ChilidItem limit of VStack and HStack.
iOS 13中引入了SwiftUI组。它们充当包装不同视图类型的容器,还使您可以解决VStack和HStack的10 ChilidItem限制。
SwiftUI, in its second iteration at WWDC 2020, offers us a few new group controls. Namely, GroupBox
, DisclosureGroup
and OutlineGroup
are now available in iOS 14 and above.
SwiftUI是WWDC 2020的第二次迭代,它为我们提供了一些新的组控件。 即, GroupBox
, DisclosureGroup
和OutlineGroup
现在在iOS 14及更高版本中可用。
Let’s walk through each of these.
让我们逐一介绍。
组框 (GroupBox)
GroupBox
is a stylized container view with an optional Label
, and earlier it was only available in macOS. Now you can use it to logically group views and build things like a login screen, a custom alert dialog, and more.
GroupBox
是带有可选Label
的风格化容器视图,并且在早期,它仅在macOS中可用。 现在,您可以使用它在逻辑上对视图进行分组并构建诸如登录屏幕,自定义警报对话框之类的内容。
Here’s the code that shows how to create a GroupBox
in SwiftUI:
这是显示如何在SwiftUI中创建GroupBox
的代码:
GroupBox(label: Label("Enter Details"), content: { VStack{
TextField("Username", text: $text)
Button(action: {}) {Text("Submit")}
}})
View modifiers work