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

How to change TabView color for each icon?

I've tried this to try to change the color of the tab icons individually, but for some reason, the color will modify it correctly and then after tapping back to the icon, it will not display the customized color. How would I go about changing the…
0
votes
1 answer

How to set the color of unsafe area in a NavigationView

I want the color above the titlebar of NavigationView to remain the same, even when I scroll the list. I've tried using UINavigationBar to set it, but it doesn't work in unsafe area, and tt still turns gray when sliding down. import SwiftUI struct…
Hz Shang
  • 105
  • 1
  • 9
0
votes
2 answers

SwiftUI ColorPicker cause pop to root view

I have this weird issue. When I click the ColorPicker, the view dismissed and pop back to the root view. I have attach a screen record below. Anyone have idea how to fix this issue? The code run on simulator ios 15.2 See screen record here import…
0
votes
2 answers

How to move to next field programmatically in nested custom form with custom fields in SwiftUI

I have list of custom fields in a custom form view. The form view is loaded in the content view, which will inform the form view to move to the next field, when the user taps on "Next" button. The question is how the form view will make the next…
Ofcourse
  • 617
  • 1
  • 7
  • 19
0
votes
2 answers

Change a property on TabView drag gesture in SwiftUI (View pager)

I have written a generic ViewPager with TabView and it works perfectly. However, I want to pause the timer (auto swipe) when user starts dragging and resume it when user finishes the dragging. Is there anyway to do that? This is my ViewPager: struct…
BabakHSL
  • 622
  • 1
  • 8
  • 18
0
votes
1 answer

SwiftUI - Why is my TabBar ignoring the set color method in the init()?

I have a TabView. In the TabView are two views - HomePageView and StatsPageView. the HomePageView is the first view to load. when the home page loads the tabbar has a white background instead of the pink background set in the init() method. when I…
zamanada
  • 158
  • 13
0
votes
1 answer

Swiftui hiding subviews when navigating to next screen

I have a screen with a button that, when pressed, displays a subview with a new set of buttons. If I click any button in the subview, it should hide the subview and take me to the next view. The strange thing is that I can remove the view with a…
Mac_Play
  • 302
  • 4
  • 21
0
votes
0 answers

How to create Dynamic TabView Filtered?

Goal: To create a Dynamic TabView that displays Todo Items filtered by their Category on each TabView. What is the best way to go about this in my current code? I don't want to modify the FetchRequest. This is the TabView, I want to show the List of…
Justin Comstock
  • 175
  • 1
  • 13
0
votes
1 answer

Make SwiftUI TabView wrap its content

Is it possible to make paged TabView that wraps its content? I don't know the height of the content (it is an Image resized to fit the width of the screen) so I can't use frame modifier. My code looks like this: ZStack(alignment: .topTrailing) { …
Ella Gogo
  • 1,051
  • 1
  • 11
  • 17
0
votes
1 answer

TabItem + AsyncImage - image is extremly big

I'm trying to load image async using AsyncImage - but the results is that the image is very big and covers all the screen. TabView { CreateView() .tabItem { Image(systemName: "plus.circle") …
Udi Oshi
  • 6,787
  • 7
  • 47
  • 65
0
votes
0 answers

Programmatically changing tab in SwiftUI doesn't update the child views

Building a pageview that acts as a vertical carousal for videos that autoplay when they are in viewport and pause when out of viewport. Autoplay when in view seems to be working so far(although a bit hacky and an improvement advice is welcomed). An…
0
votes
1 answer

TabItem switching not working properly in iOS13 devices

I have created demo of Tab bar with two tabItems. Each tab-item have view controller in it. On switching tabs, it is not showing its respective UI. This is happening on iOS 13 only. Code: struct ContentView: View { private enum Tab: Hashable { …
Bhupesh Kumar
  • 369
  • 2
  • 18
0
votes
1 answer

Swipe back when using a custom navigation bar and a TabView SwiftUI

I have a SwiftUI app which uses a custom navigation bar. Because of that, I need to handle the back navigation separately (both the back button and the swipe gesture). Everything went fine up until now, when I need to use a TabView to swipe between…
0
votes
1 answer

Does TabView miss navigation clicks while redrawing?

I have a vanilla TabView, an @ObservedObject, and a background task running which periodically updates the @Published field of the @ObservedObject. I've noticed that when the background task runs more frequently, and generates more changes to the…
0
votes
1 answer

Limit the number of dots in Page Tab View Swiftui

I am trying to use the PageTabview option to allow a user to move through a series of pages whose data is coming from a JSON file. I want to be able to limit the number of visible dots to 5 or 6 even if there are many values in the field. What I…
crr-swift
  • 13
  • 5