Questions tagged [swiftui-tabview]

For questions about TabView - a component in Apple's SwiftUI framework that switches between multiple child views using interactive user interface elements. When using this tag also include the more generic [swiftui] tag where possible.

Links:

  • Apple Developer Documentation for TabView.
325 questions
1
vote
2 answers

Is there a bug in visionOS TabBar Preview?

Playing around with visionOS I'm rewriting SwiftUI tutorials to launch on Xcode visionOS simulator, everything's working fine so far, but adding any TabView makes preview crash (even when it's working on running). Here's my code. TabView(selection:…
ssantos
  • 16,001
  • 7
  • 50
  • 70
1
vote
0 answers

Why are images in TabView cropped in SwiftUI?

I'm creating a TabView in SwiftUI that uses a vertical scrolling mechanism to display images. However, the images are cropped on the sides with the code I'm using, and I'm looking for an uncropped look. Interestingly, they only become cropped when…
1
vote
1 answer

SwfitUI: Use .blur cause navigation title overlap with safe area

I want to blur the app when it's in the background so I have this in my TestApp.swift import SwiftUI @main struct TestApp: App { @Environment(\.scenePhase) var scenePhase var body: some Scene { WindowGroup { …
Doraemoe
  • 129
  • 2
  • 11
1
vote
1 answer

SwiftUI: List and TabView are getting over-lapped each other

In my app, i am trying to display: SegmentedPicker on top of the screen, Then List, Then a simple button on bottom-right of the screen using safeAreaInset, and then a tabBar using TabView My problem is that at bottom of the screen, List and TabView…
Bhanuteja
  • 771
  • 2
  • 8
  • 18
1
vote
1 answer

SwiftUI: RoundedRectangle ignores safe area?

I'm learning SwiftUI and noticed some weird behaviour regarding RoundedRectangle, which is used to draw dividers. See in the screenshot below, the RoundedRectangle with width = 1 ignores top and bottom safe area, where as if I use Divider() instead,…
Heuristic
  • 5,087
  • 9
  • 54
  • 94
1
vote
0 answers

SwiftUI] access multiple NavigationStack

I use TabView & NavigationStack. TabView covered NavigationStack & inner View also covered NavigationStack. I want an inner navigation Push but it's always the root Navigation Push (in TabViewTest). Can I push the inner NavigationStack View (in…
이기완
  • 11
  • 2
1
vote
0 answers

Overlay button not working in SwiftUI whenever it has padding

I have an overlay button in my SheetView which dismisses it: .overlay( Button { presentationMode.wrappedValue.dismiss() } label: { Image(systemName: "xmark") } …
1
vote
1 answer

Make second view gray SwiftUI

I have 2 views. 1 main view and 1 alert view. The alert view will appear in the front of the main view. I want to lower the white color from the entire main view when this happens. Like a gray or light gray when the alert view is on front. My main…
1
vote
1 answer

App Lost all selection info of navigation and tab, after update a AppStorage state

I want to realize a function which could change the color scheme of app. However, whenever I click theme style in ThemeView, it will pop to SettingsView and Tab will reselect to Home. Is there a way that I can change the color scheme of app, and…
1
vote
1 answer

SwiftUI Tab Bar Item Duplicating

This is weird, I have a tab bar with 4 defined tabs and the last item is duplicating itself. TabView { HomeView() .tabItem { Label("Home", systemImage: "chart.bar.fill") } GroupsView() .tabItem { …
1
vote
0 answers

Accessibility on Tabview cause resetting tab

I'm using TabView to have a simple onboarding contents. It seems like when voiceOver is enabled and tabview get the focus binding variable automatically will reset to 0. here is sample app I made for this issue: struct ContentView: View { @State…
Ali
  • 287
  • 1
  • 2
  • 13
1
vote
0 answers

Swiftui vertical paging tabview with scrollview inside

My goal is to have a vertical paginated tabview with a scrollview inside. Scrolling as soon as you finish the scrollview you pass to the other tab and if the content of the scrollview has a lower height than the screen, scrolling passes directly to…
Stefano Vet
  • 567
  • 1
  • 7
  • 18
1
vote
2 answers

Disable swipe on TabView while editing (swiftui)

I'm trying to disable the possibility to swipe a TabView in swiftui while a variable (Bool) is set to true but I must miss something very simple. I found an answer here as well as many other posts saying the same but when I run a test it doesn't…
Slamit
  • 465
  • 1
  • 6
  • 21
1
vote
1 answer

Change Table Background color Swiftui

Hi the swiftui code below shows a table with a title at the top, what I can't do is change the background of the table to gray and align everything at the top, how can I do? below is the current swiftui code, thanks SwiftUI Code: // // …
riki
  • 1,502
  • 5
  • 17
  • 45
1
vote
1 answer

Swiftui Tabview causes issues with Textfield

In SwiftUI, whenever I have a TextField inside a TabView, when I use a bluetooth barcode scanner, the Textfield never gets the correct value from the scanner, it always skips numbers. Sometimes it skips 50% of the barcode, sometimes just 1 or 2…
Axxi
  • 193
  • 1
  • 10