The app only supports the potrait mode. Two questions should be displayed, but they are rotated accordingly. So the players can see the questions well, no matter where they sit.
Anyway, it seems that the bounding box is not rotated while rotating.
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)
}
}
}
I have tried many different things. I left out the GeometryReader
and worked with 'fixedSize()`. Then I get a one-liner that goes across the screen.
I have also tried this solution, but it does not work as expected.
My result is always a text which does not use the full width. (The overlapping is just another mistake, but I will definitely get that under control).