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

List row separator not hiding when using another view on top

I am using a package that hides the list view separator for iOS 14. https://github.com/SchmidtyApps/SwiftUIListSeparator Whenever I add another view on top of the List, like a simple Divider(), the list row separator will appear again for no…
dhaval123
  • 107
  • 11
0
votes
0 answers

Remove separator line from list iOS 14

I want to remvove the separator line from the list elements for iOS 14. I have a preview: struct TestView: View { let screenSize = UIScreen.main.bounds var body: some View { VStack{ List{ ForEach(1...3, id:…
user20810748
0
votes
1 answer

SwiftUI TabView prevent swipe bounce

I have a TabView with .tabViewStyle(PageTabViewStyle()) I am trying to prevent the first view and last view from bouncing. So basically, prevent scrolling horizontally. struct ContentView: View { @State var stop = false var body: some View…
slik
  • 5,001
  • 6
  • 34
  • 40
0
votes
1 answer

SwiftUI custom TabView with paging style

I'm trying to create a custom TabView in SwiftUI, that also has a .tabViewStyle(.page()) functionality too. At the moment I'm 99% of the way there, but cannot figure out how to get all the TabBarItems to list. I'm using the PreferenceKey so that the…
markb
  • 1,100
  • 1
  • 15
  • 40
0
votes
0 answers

In SwiftUI, why does a .searchable searchbar disappears after the user taps cancel (when the content is a TabView with .page style)?

In SwiftUI, I have a .searchable searchbar with a TabView in the .page style as the content. When the user taps the cancel button, the searchbar disappears. import SwiftUI struct ContentView: View { @State var searchText = "" var body:…
Dan Flict
  • 117
  • 8
0
votes
0 answers

on osx SwiftUI ListRow has a 8px leading edges,how to remove it

i set cell width 382px but only get a 365px var body: some View { List() { HStack(){ Text("what happen ") }.frame(width: 382,height: 101) .background(Color.yellow) } .background(Color.green) …
Simp.L
  • 1
  • 2
0
votes
2 answers

Background won't cover whole page

ScrollView { ZStack{ NavigationView(){ List {...} .toolbar {...} } .sheet(isPresented: $showingProfile) {...} .sheet(isPresented:…
Thijs
  • 1
0
votes
0 answers

Listening to LongPressGesture on Subview makes parent TabView pager unswipeable

Here is a Tabview pager with 3 pages. The LongPressGesture is well detected, but swiping from the VStack subview has no effect. (It works if I swipe from outside the VStack though). struct MainView: View { var body: some View { TabView…
Jérôme Boé
  • 2,752
  • 4
  • 21
  • 32
0
votes
1 answer

How can i remove this space from a SwiftUI custom CustomTabBar

You can see the issue in the image below there is a space above the Rectangle with a teal Color that I cant remove so that code can match the design. You can replicate the issue using the code below: import SwiftUI @main struct…
byaruhaf
  • 4,128
  • 2
  • 32
  • 50
0
votes
2 answers

How can I fix - Swiftui tabview focus error on tvOS 15.2

In tvOS 15.2, when using tabView in scroll, it comes back when going from left to right. While tvOS 14 and 16 don't have this issue, I'm facing this issue in 15.2. You can see the gif : https://gifyu.com/image/SmE5Q My code import SwiftUI struct…
Metin Atalay
  • 1,375
  • 18
  • 28
0
votes
0 answers

tab bar customisation swift ui

i am new in swiftUI and i want to make custom tab bar. Let's ignore effects and icons. I create new struct struct BottomPoligon: Shape for draw this Shape and after this i create new view TabBarView: struct TabBarView: View { var body: some View…
Stefan
  • 55
  • 8
0
votes
0 answers

swiftui -- tabview has error when use offset

I found the height was wrong when I'm dragging,how can i fix it? The height in the tabview will be subtracted from the safe height when dragging. work with tabview with background work with tabview without background work with backgroun without…
GAP1994
  • 1
  • 1
0
votes
0 answers

I want to hide the TabBar in subview - SwiftUI

I got 3 views, the main view is MyTabView, and I would like to hide the TabBar when I navigate to a subview, and I define a class to store config which called TabBarConfig, and I pass it to subviews using EnvironmentObject. But when I change the…
leo
  • 82
  • 1
  • 6
0
votes
1 answer

swiftui tab bar takes time to change color

I have a custom tab bar. In each view, I load some data for the database. With 4 different views, whenever I click a view, the color will change, to easily know what view we are present on. However, for the view that loads more data than the other,…
user20810748
0
votes
0 answers

Left or right swipe through a page of ItemsDetailsView within destination of NavigationLink

Using the code below, I'm displaying a list of filtered items that when clicked leads to a detailed items page ItemDetailView(item: item) for that specific row. I am trying to make it so that the user, once on the details page can then swipe left or…