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
0
votes
1 answer

SwiftUI present sheet in a TabItem of TabView using presentationDetents

I am trying to create the same experience where a sheet is presented in one of the tab items of a TabView - not covering the tabs. I am using .presentationDetents() and SwiftUI4.0 for that. See example of Apple's own app doing that The sheet is…
Y.H.
  • 1
  • 2
0
votes
0 answers

SwiftUI tabview changes when made scrollable

I have set up a tabview as shown below var body: some View { TabView(selection: $selection){ BookingView() .tabItem{ selection == 0 ? Image("bookReaderGreen") :Image("bookReaderDark") …
IndexZero
  • 184
  • 1
  • 11
0
votes
1 answer

How to hide tab bar swift ui ios

I implemented my own tab bar: struct MainView: View { @State var selectedIndex = 0 let icons = ["menucard", "house"] let iconsNames = ["meniu", "oferte"] var body: some View{ VStack(spacing: 0){ ZStack{ …
0
votes
0 answers

How do I disable the drag gesture on the navigation dots in a tabview to go between pages in SwiftUI?

I use tabviews as stages for practices and I already disabled all swipe events to go between the tabs / stages. However, when you press and swipe or drag on the navigation dots you can still switch between the tabs. Preferably I would like to keep…
Florian
  • 107
  • 1
  • 8
0
votes
0 answers

The app preview on pc is not the same when uploaded to iphone

I have created a simple background with a menu in swiftui - The content view and IOS simulatores display my app correctly. But when i upload the app to my iphone, i lose my custom background and features of the menu bar. The tutorial that i have…
0
votes
0 answers

How to add TabView/anything under NavigationView?

I have this code to display NavigationView with toolbar, searchable: var body: some View { NavigationView { TabView(selection: $selectedIndex) { ... } .tabViewStyle(.page(indexDisplayMode: .never)) …
0
votes
0 answers

Get back to root view

I have a view that's inside a TabView and I want to make the TabItem return the user to the root view when they click on it. The view: import SwiftUI struct FeedsView: View { var body: some View { NavigationStack { List { …
0
votes
1 answer

Can we have a SwiftUI TabView with more than five entries?

I have a set of seven pages. I have made my own scrollable view. I have a working solution where I have the current page and attach gestures to it like this... switch page { case .EyeTest: EyeTestView(sd: $sd) …
Richard Kirk
  • 281
  • 1
  • 12
0
votes
2 answers

Swift navigation bar not appearing

I’m new to Swift. Currently trying to build a test app. My tab nav bar won't appear when i preview the app. When in preview, i can click it and switch between pages, but i can't see it. Created a storyboard with a tab bar controller and view…
0
votes
0 answers

SwiftUI: Wrong TabView's Tab Bar height in landscape mode

This is a simple example of programmatic Tab Bar height calculation for TabView: import SwiftUI struct ContentView: View { let tabbarHeight = UITabBarController().tabBar.frame.height var body: some View { TabView { …
0
votes
0 answers

SwiftUi with TabView and navigationView

I'm migrating a large iOS project developed using VIPER architecture from ViewControllers to SwiftUi. To do this I'm using ViewAdapters to connect VIPER routers and presenters with SwiftUI views. Although this is working fine I'm having problems…
0
votes
0 answers

SwiftUI TabView PageTabViewStyle Pull to Refresh

I am using a TabView PageTabView to mimic TikTok's main UI (full screen carousel swiping up and down) with the following code. @State var tab_pos = 0 var edges = UIApplication.shared.windows.first?.safeAreaInsets TabView(selection: $tab_pos) { …
Swapnil
  • 11
  • 2
0
votes
1 answer

Swiftui change tabview bar color

Here is my view: var body: some View { TabView { CountriesView(homeViewModel: homeViewModel) .tabItem { Label { Text("Home") } icon: { Image(systemName:…
themmfa
  • 499
  • 4
  • 15
0
votes
0 answers

SwiftUI - Fullscreen nested TabViews without visual glitch

I'm trying to get nested TabViews working in SwiftUI to achieve an onboarding flow prior to the main tabbed app screen but am running in to a non-obvious visual glitch. I'd like the onboarding portion to be full-screen, ignoring safe areas, but the…
Robin Macharg
  • 1,468
  • 14
  • 22
0
votes
0 answers

TabView taking Top Space in SwiftUI

Hi I am currently working on swiftUI project. I am facing a very strange issue. Here is the code for my problem. As you can see that, this tabView is taking some space from the Top which is highlighted in Red Color. It should be All blue in the…