SwiftUI:文本在旋转后未达到屏幕的全宽

SwiftUI:文本在旋转后未达到屏幕的全宽,swiftui,Swiftui,该应用程序仅支持potrait模式。应显示两个问题,但它们会相应地旋转。因此,无论球员坐在哪里,他们都能很好地看到问题 无论如何,旋转时边界框似乎没有旋转 ZStack { HStack { GeometryReader { proxy in Text(challenge) .rotationEffect(Angle(degrees: 90), anchor: .center)

该应用程序仅支持potrait模式。应显示两个问题,但它们会相应地旋转。因此,无论球员坐在哪里,他们都能很好地看到问题

无论如何,旋转时边界框似乎没有旋转

ZStack {
        HStack {
            GeometryReader { proxy in
                Text(challenge)
                    .rotationEffect(Angle(degrees: 90), anchor: .center)
                    .frame(maxWidth: proxy.size.height, minHeight: proxy.size.width)
                    .foregroundColor(.red)
                    .font(.largeTitle)
                    .background(Color.blue)
            }
            Spacer()
            GeometryReader { proxy in
                Text(challenge)
                    .rotationEffect(Angle(degrees: 270), anchor: .center)
                    .frame(maxWidth: proxy.size.height, minHeight: proxy.size.width)
                    .foregroundColor(.red)
                    .font(.largeTitle)
                    .background(Color.blue)
            }
        }
    }
我试过很多不同的东西。我省略了
GeometryReader
,使用了“fixedSize()”。然后我得到了一条穿过屏幕的直线

我也试过了,但没有达到预期效果

我的结果总是一个不使用全宽的文本。(重叠只是另一个错误,但我肯定会控制它)

我真正想要的是:
这里是一个可能方法的演示。使用Xcode 12.1/iOS 14.1编写

struct DemoView: View {
    var body: some View {
        HStack {
            RotatedText(text: lorem, angle: Angle(degrees: 90))
            RotatedText(text: lorem, angle: Angle(degrees: -90))
        }
    }
}

struct RotatedText: View {
    let text: String
    let angle: Angle
    var color: Color = .blue
    
    var body: some View {
        color.overlay(
            GeometryReader { gp in
                VStack {
                    Text(text)
                        .frame(width: gp.size.height, height: gp.size.width)
                        .rotationEffect(angle)
                }.frame(width: gp.size.width, height: gp.size.height)
            }
        )
    }
}