【发布时间】:2020-05-31 19:29:35
【问题描述】:
我想调整小部件的大小以适应小部件内容的整体大小。问题是,标准形状(小部件的背景)默认为可用空间,我不想硬编码它的框架。任何建议,例如使用 GeometryReader?
struct WidgetView: View {
var body: some View {
ZStack {
RoundedRectangle(cornerRadius: 40, style: .continuous)
.foregroundColor(.gray)
Text("TestingText")
}
}
}
【问题讨论】:
标签: ios swiftui size frame shapes