视图从模态演示的左右边缘压缩

在开始演示时,SwiftUI表单视图的行为很奇怪。 左右的边缘布局破了

有什么办法避免这个问题吗?

struct FormactionTest: View {
@State var isShow : Bool = false
var body: some View {
    Form{
        HStack{
                Text("TEST")
                Spacer()
                Text("TEST")
            }
        HStack{
            Button(action: {
                self.isShow.toggle()
            }) {
                Text("Alert")
            }
        }
    }.actionSheet(isPresented: $isShow,content: {
        actionSheet(title: Text("TEST"))
    })
}

使用Xcode版本11.2 beta 2(11B44)在模拟器和真实设备中进行了尝试。

maidh521 回答:视图从模态演示的左右边缘压缩

这是ListForm的一个非常常见的视觉错误,仍存在于Xcode 11.2中。不幸的是,只需report it并等待修复。

本文链接:https://www.f2er.com/3166123.html

大家都在问