qt中groupbox外观_iOS 14中的SwiftUI的GroupBox,OutlineGroup和DisclosureGroup

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的第二次迭代,它为我们提供了一些新的组控件。 即, GroupBoxDisclosureGroupOutlineGroup现在在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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值