Fixed padding on components

This commit is contained in:
cdricms
2024-07-10 11:49:48 +02:00
parent 4c9665a41b
commit 675f4ee89b
2 changed files with 12 additions and 11 deletions

View File

@@ -16,11 +16,13 @@ struct ContentView: View {
@State private var segmentedSelection: SegementedSelection = .search @State private var segmentedSelection: SegementedSelection = .search
var body: some View { var body: some View {
NavigationStack { NavigationStack {
VStack {
Picker("", selection: $segmentedSelection) { Picker("", selection: $segmentedSelection) {
ForEach(SegementedSelection.allCases, id: \.self) { sel in ForEach(SegementedSelection.allCases, id: \.self) { sel in
Text(sel.rawValue).tag(sel) Text(sel.rawValue).tag(sel)
} }
}.pickerStyle(.segmented) }.pickerStyle(.segmented)
.padding(.leading, -8)
switch segmentedSelection { switch segmentedSelection {
case .search: case .search:
SearchView() SearchView()
@@ -29,6 +31,7 @@ struct ContentView: View {
} }
} }
} }
}
} }
#Preview { #Preview {

View File

@@ -13,8 +13,6 @@ struct SearchView: View {
var body: some View { var body: some View {
VStack { VStack {
TextField("Search", text: $query) TextField("Search", text: $query)
.padding()
.padding(.bottom, 0)
.onSubmit { .onSubmit {
brew.getInfo(on: query) brew.getInfo(on: query)
} }