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 / iOS 15 - UIKit view made twice

In my SwiftUI test app, I have this code wrapping a UIKit view in a TabView and a NavigationLink: import SwiftUI @main struct NavLinkTestApp: App { var body: some Scene { WindowGroup { MasterView() } } } struct…
protasm
  • 1,209
  • 12
  • 20
0
votes
0 answers

Auto-selection of a item from a list of items and navigate to a view which focus on the selected item

Hi I'm new to swiftUI and I'm stuck in a issue. Description: The problem is to navigate to a screen of different tab. Ex: I have a view in tabItemB which displays a selected list of student id's who belong to different class sections like class 5A…
0
votes
0 answers

iOS 15 Empty White Space at Bottom

I have a view in which there is a imageslider using tabview and a background color in ZStack. In addition, at bottom there is a HSTack having some buttons. The code is as follows : struct HomeScreen: View { @State private var currentIndex =…
Joji
  • 21
  • 4
0
votes
0 answers

Tab Bar Curve SwiftUI

I need to round the edges of the tabbar and make a rectangular line on each button when pressed. It is necessary to make a corner radius for the tabbar and a rectangular curve for the code button. The code is working, but I need help. thank…
0
votes
0 answers

SwiftUI: Navigate from List to side-scrolling TabView

In my SwiftUI/iOS 15+ app I would like to allow the user to navigate from a List to a side-scrolling TabView, such that tapping the Nth item in the List navigates directly to the Nth page in the TabView. (From there, the user can swipe left/right…
protasm
  • 1,209
  • 12
  • 20
0
votes
0 answers

SwiftUI: How can i allow user to drag filled image in a TabView page while keep change page gesture

I'm using TabView with page style to show a list of Images: Reader.swift ... TabView(selection: self.$archivePageModel.currentIndex) { ForEach(pageOrder(totalPage: archivePageModel.pages.count), id: \.self) { index in PageImage(id:…
Doraemoe
  • 129
  • 2
  • 11
0
votes
0 answers

LazyVstack inside TabView

LazyVstack insde TabView wrapped on scrollView not working (performance issue) var body: some View { ScrollView { Text("hello, world!") TabView(selection: $tab) { p1().tag(0) P2().tag(1) } …
0
votes
1 answer

Swiftui Vertical TabView strange margin

I have a TabView rotated to move vertically. Everything works fine, but a strange margin remains on the right. I've tried hiding the navigationbars, but there's always a strange border on the right. Removing .ignoresSafeArea() solves the problem,…
Stefano Vet
  • 567
  • 1
  • 7
  • 18
0
votes
0 answers

How to call Some View returns function in Alert in swiftUI

How to call some view function in alert in swift I have created this function for showing some data in alert(not in sheet or popover).how can I call this message in alert in swiftUI and please create if any extensions neededenter image description…
MVM
  • 1
0
votes
1 answer

SwiftUI Change TabItem Background Color Not Foreground When Selected

In SwiftUI the TabView changes the foreground color of the TabItem when it is selected. But I need to keep the TabItem foreground one color (selected or not) and changed the background color. Here is an example: TabView with TabItem background color…
Cyklist
  • 1
  • 3
0
votes
1 answer

SwiftUI TabView Pagination where tabItem overlap the middle tabitem view?

I am trying to create a TabView with pagination where the middle view is always overlapped when swiping to the next view, left or right. Not exactly sure if this is possible with SwiftUI? struct ContentView: View { @State private var selection =…
slik
  • 5,001
  • 6
  • 34
  • 40
0
votes
0 answers

Swiftui Navigation Stack not displayed bottom tabbar in child screen

When i am pushing from home to chat screen it wont showing me bottom tabbar i want to display it struct MainRouterView: View { var rootScreen:ScreensPath @ObservedObject var router: Router init(rootScreen:ScreensPath) { …
0
votes
0 answers

SwiftUI NavigationView With TabView PagingControl Padding

NavigationView { VStack { TabView { ForEach(0...4, id: \.self) { index in VStack { ZStack(alignment: .center) { …
0
votes
0 answers

SwiftUI: How to Toggle Gestures Between TabView and Charts

anyone know how to toggle gestures between subviews? I have a TabView that is made up of 3 pages. Swiping on the page navigates me to another page. In one of the pages, I used Apple's Chart API, that contains a Drag Gesture. Idea is to longPress on…
Kenny Ho
  • 409
  • 3
  • 16
0
votes
2 answers

Why is the search view persisting between tabs?

I have the following code. Initially everything looks alright. However, when I switch to the "Items" tab and then back to the "Rooms" tab, the search view persists. I want it to disappear when "Rooms" is selected. import SwiftUI struct HomeView:…
Cameron Henige
  • 368
  • 2
  • 17