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

What is 'tag' of tabItem in SwiftUI?

I'm beginner of SwiftUI I recently learning SwiftUI with Youtube Lecture In TabView part, TabView { myView(titleText: "프로필", bgColor: Color.blue) // it's just View I made .tabItem { Image(systemName :…
999rimmy
  • 35
  • 3
3
votes
2 answers

How to hide TabView when opening a new view with NavigationLink?

Assuming we have a SwiftUI view containing struct ContentView: View { var body: some View { TabView { FirstView().tabItem { // tabItem image and text } SecondView().tabItem { …
3
votes
1 answer

SwiftUI reload view on double tap on tab item

I'm trying to implement a feature to an app I'm working on so that when a user taps a tab twice, it will automatically send the user back to the tab's initial view. Suppose that I want the following "Devices" tab button to reload the view on a…
RnadomG
  • 145
  • 1
  • 9
2
votes
2 answers

How to hide TabBar while pushing next screen in swiftUI

I want to hide TabView bottom TabBar if user navigate from next screen. For example I have TabView that have two tabItem let's say Home and Account and home screen have notification option if user click notification I want to navigate to…
2
votes
0 answers

Adding modifier .tabViewStyle(.page) breaks NavigationStack embedded in TabbedView

This seems like a bug to me or I am just missing something obvious...as soon as I add the .tabViewStyle(.page) modifier to the below code it breaks the NavStack navigation. I can click the NavLink once and when I go back from the detail view I can't…
david dt
  • 31
  • 2
2
votes
0 answers

NavigationStack to TabView

I've spent sometime going over questions on Stack Overflow and couldn't find an answer. I'm trying to navigate from a List View (similar to a Sidebar) to a View that contains a TabView. However, when I move to the TabView the Navigation Title and…
Pam
  • 121
  • 3
2
votes
1 answer

Making a symbol image not filled on iOS versions below 15.0

I have a TabView with labels, I am not sure why this isn't documented at all and I've found on another question on the stackoverflow that the following lines of code only works on iOS 15.0: if (selectedTab == 2) { Label("Playlist",…
yuroyami
  • 814
  • 6
  • 24
2
votes
0 answers

NavigationStack inside paged TabView is broken

I want to have horizontal paging with navigation bars on each page. Going with TabView, there is an issue in combination with page style when nesting NavigationStack. Let me show you an example. The following code works but uses tabs. var body: some…
2
votes
0 answers

How to remove the space from top of the list

I have a swiftui app. I want to remove the space that is automatically created on the top of the list, but without using the .listStyle(PlainListStyle()). var body: some View { VStack{ Text("HELLO") List{ …
2
votes
2 answers

Problem when trying to hide tab bar SwiftUI

There have been several questions like this one. There is a small difference which I didn't notice in any other answers. Basically I have a TabView and EACH of its items is wrapped inside NavigationView. Because it is done this way and not the other…
2
votes
1 answer

SwiftUI navigation link screen pops when change color theme

I have a TabBar view with a single tab (for the demo purposes). The tab view screen has a NavigationLink button which sends you to a screen with a Text box only. The problem that occurs is that whenever I am on the second screen and change the color…
2
votes
1 answer

NavigationStack and TabView in Swiftui iOS 16: bug or improper usage?

[Xcode 14.1, iOS 16.1] I have a NavigationStack with a navigationTitle and a TabView with 2 Views. Each View has a ScrollView (see image below): NavigationStack and TabView problem image When I tap on Tab1 (#1 in red on the image above), then swipe…
2
votes
1 answer

SwiftUI - Attempted to scroll the collection view to an out-of-bounds item

My App is getting crashed immediately after navigating to the screen in iOS>16.0 devices by saying *** Assertion failure in -[_TtC7SwiftUIP33_8825076C2763A50452A210CBE1FA4AF020PagingCollectionView _validateScrollingTargetIndexPath:],…
Bhanuteja
  • 771
  • 2
  • 8
  • 18
2
votes
0 answers

SWIFTUI Tabview makes me long press after embedding in UiHostController, how do I stop this?

I am adding a SwiftUi view to my story board via UIHostController. The integration works and I have full functionality of buttons and image taps, however the Tabview at the bottom of the screen requires a long press in order for the Tabview to work…
2
votes
1 answer

SwiftUI TabView loses selection when container size changes given safe area ignored

I need to ignore the safe area of a TabView so that ScrollViews within the different pages will show their scrollable content outside the safe area. When the container's safe area changes, for example when the keyboard is shown, the view will be…
Will Alexander
  • 337
  • 2
  • 16