I’m struggling getting the grasp of how build a fitting UI for a Watch App using SwiftUI
What I mean by fitting is that I wanna create a screen that shows some informations without resorting to scrolling.
The UI should be adaptive to the screen size and fit the UI elements and I would also like to be able to drop low priority UI elements when the space is not enough.
I tried to create a sample VStack of Text elements and than use properties like `layoutPriority(...)` and `.minimumScaleFactor(...)` to let the content fit the container but with no luck.
Given the following code. The result I see on screen is a list of big Texts overflowing the available space. Doesn’t matter what combination of `layoutPriority(...)` /`.minimumScaleFactor(...)` methods I use
struct ContentView: View {
var body: some View {
VStack() {
Text("Hello World").font(.title)
Text("Hello World").font(.title)
Text("Hello World").font(.title)
Text("Hello World").font(.title)
Text("Hello World").font(.title)
Text("Hello World").font(.title)
Text("Hello World").font(.title)
}
}
}
Results in
View post on imgur.com
Is there a way in swiftUI to build a fitting UI that can scale the contents to fit the available space rather than just relay on what space the contained View wants to use? Also is there a way to drop UI elements if the space available is not enough?