Post

Replies

Boosts

Views

Activity

Screen layout positioning in Swift
Hello everyone, I’m just trying to position these times and check boxes side by side as shown in the attachment. So far no matter what I try, it only lists. There are more fixed times for example 10:00am all the way to 6:30pm. The user picks the times that they are NOT available. This is a sample of the code below. The check boxes work fine, it’s just the screen layout I’m having issues with. Any advice will be appreciated. ..................................... import SwiftUI struct ContentView: View { @State private var wakeup = Date.now @State private var isCheckedOption900 = false @State private var isCheckedOption930 = false var body: some View { Text("Select unavailable Dates/Times") DatePicker("Please enter a date", selection: $wakeup) .labelsHidden() } Form{ Section("Enter Blockout times") { Toggle(isOn: $isCheckedOption900) { Text("9:00am") } .toggleStyle(CheckboxToggleStyle()) Toggle(isOn: $isCheckedOption930) { Text("9:30am") } .toggleStyle(CheckboxToggleStyle()) }
Topic: UI Frameworks SubTopic: SwiftUI
1
0
393
3d