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
4 answers

Content inside TabView is not growing Inside ScrollView

I am facing very serious problem in my project. The scenario is something like this. A SwiftUi screen has NavigationBar -> Sticky Header -> Horizontal TabBarItems -> TabView then each TabView has it's own View using ListView or ScrollView as…
0
votes
1 answer

SwiftUI TabView bottom whitespace (PageTabViewStyle)

I am trying to make an app that has pages (kind of like how a book app displays the pages of a book). To do this I am using the TabView with the PageTabViewStyle modifier. The issue is that I want the tab's content (which is in a scrollView if that…
0
votes
0 answers

SwiftUI TabView not selected sometime

The TabView works well most of the time. But when the App launch the first time, the selection not working. Here is the code, struct ContentView: View { @State private var selection: Int = KV.lastTabPosition @State private var showFab:…
Shawn Wong
  • 554
  • 6
  • 15
0
votes
1 answer

TableView changes not work correctly in swiftUI

I'm using a UITableView in SwiftUI. I get data from WebSocket and I want to update my tableview live. I successfully get the data from the network and update it in viewModel and pass it to QuotesTableView. TableView does not update my data…
Kenan
  • 3
  • 2
0
votes
1 answer

In a TabView/TabItem, how can I change the image for the highlighted item and don't use the accent color?

Given TabView { WelcomeView() .tabItem { Label("Home", systemImage: "house") } } renders the TabView in the default color and, when active, the highlighted color: and active: I would like to change the icon…
Adrian Föder
  • 770
  • 1
  • 7
  • 22
0
votes
1 answer

Selectively hiding subviews in swiftui

I would like to make a view that receives heterogeneous Content via a viewBuilder, like normal, and then selectively displays only one of the child views so provided, hiding the rest. Something like what TabView does, but under my programmatic…
rgeorge
  • 7,385
  • 2
  • 31
  • 41
0
votes
1 answer

SwiftUI sign in with Apple [LayoutConstraints] Unable to simultaneously satisfy constraints

I have a sign in with apple button and I get multiple logs on the console when I build the view. SignInWithAppleButton(.signIn, onRequest: { request in isLoggingIn = true request.requestedScopes = [.email] }, onCompletion: { result in …
user20810748
0
votes
1 answer

Is there any solution for finding tabView Gesture in SwiftUI?

I have basic tabview on my screen. TabView has 4-5 contents and a timer manage it for move the next item. There is no issue until now. Then user can move the pages left or right when user make this reaction I need to stop timer and start again. Drag…
Metin Atalay
  • 1,375
  • 18
  • 28
0
votes
0 answers

Why does the list run under my tab bar when using TabView on device, but not in Simulator?

When I run this code, the list is visible behind the tab bar created by the TabView. If I comment out the Image, everything is ok. How do I make sure the list is not visible behind the tab bar? struct MainView: View { var body: some View { …
0
votes
1 answer

Glitch on animation expanding view SwiftUI

I have a search bar view, when the view is Expanding, the magnifying glass will appear as a shadow. How can I remove this? ToolbarItem(placement: .automatic) { HStack { if self.showSearchBar { HStack { …
0
votes
0 answers

Change the background color of a tabview

I try to change the color of the TabView bottom bar in swiftUI so far with no success the code I got is struct ContentView: View { var body: some View { TabView { Text("First View") .tabItem { …
Cruder
  • 29
  • 5
0
votes
1 answer

disclosure group title as pinned header for swiftui

I have a big disclosure group that its bigger that the entire screen. It is basically a big amount of text. How can I add a pinned header at the top will I am scrolling down? I need this because I want the user to know what disclosure group its…
dhaval123
  • 107
  • 11
0
votes
0 answers

SwiftUI adding animation to pages in TabView

i'm developing an app using swiftUI and i ran into some problems. Im trying to add an animation which will change scale and opacity as i'm dragging scrolling through pages in TabView which has PageTabViewStyle style. So as soon as the offset is…
0
votes
1 answer

TabView selection restores to previous one after tapping on a different tab

I'm encountering a strange behavior with TabView. In particular, I've created a UI with 4 different tabs. Every tab performs something different. The application starts with the first one selected. Tapping on the third tab FavoritesView is…
Lorenzo B
  • 33,216
  • 24
  • 116
  • 190
0
votes
0 answers

SwiftUI: How do I switch tabItems by tapping an item in a list without getting weird nested titles and back buttons?

My ContentView holds a TabView with 3 tabItems, but there's 4 views total. I get to the 4th view using a navigationLink that wraps around list rows. My problem is that when I press the navigationLink I get a weird nested view as I've shown below: I…