Questions tagged [pagetabviewstyle]

17 questions
21
votes
2 answers

How can I get rid of index dots on TabView with PageTabViewStyle in SwiftUI?

I have the following code but can't seem to remove the dots at the bottom of the TabView. struct ContentView: View { @Environment(\.managedObjectContext) private var viewContext @State var users = ["Janice", "Emily", "Candice",…
alionthego
  • 8,508
  • 9
  • 52
  • 125
9
votes
1 answer

How to tease adjacent pages in PageTabView?

I am working with SwiftUI 2 and using a TabView with PageTabViewStyle. Now, I am searching for a way to "tease" the pages adjacent to the current page like so: Is it possible to achieve this effect with TabView and PageTabViewStyle? I already tried…
Paul
  • 848
  • 12
  • 33
3
votes
1 answer

SwiftUI: PageTabViewStyle() newly broken when inside ScrollView or List?

So this bug appeared out of nowhere. I have a TabView with PageTabViewStyle() for displaing images inside a ScrollView. Below the images is other content (header, text etc, not relevant for this example). Everything used to work fine, but after the…
blu-Fox
  • 401
  • 6
  • 14
3
votes
1 answer

How to detect swiping (and execute an action upon it) with an iOS14 TabView's PageTabViewStyle() page-swipe?

Using Swift5.3.2, iOS14.4.2, XCode12.4, I am struggling with this new iOS14 feature for creating PageViews in SwiftUI. It all works, except I cannot detect the moments of swipe ! I tried using .onChange(selectionIndex) but as soon as I create this…
iKK
  • 6,394
  • 10
  • 58
  • 131
3
votes
0 answers

Page swipes not smooth with SwiftUI's PageTabViewStyle TabView

Using Swift5.3.2, iOS14.4.2, XCode12.4, I am trying to make a PageView in SwiftUI, using iOS14's new PageTabViewStyle for TabViews. The pages shall be swappable smoothly from page to page. It all works as long as I am not doing any kind of…
iKK
  • 6,394
  • 10
  • 58
  • 131
3
votes
2 answers

Getting the current index in TabView (PageTabViewStyle)

I can't added gif. I uploaded YouTube. Link here. When Tabview is swipe, I want to show that image in imageView below. Note: My code didn't work when I tried it with the model. That's why I edited my question. MainView struct MainView: View { …
Ufuk Köşker
  • 1,288
  • 8
  • 29
2
votes
0 answers

SwiftUI's tabViewStyle PageView does not work for Portrait to Landscape rotation

Using Swift5.5, iOS15.0.1, To create a PageView is still not that simple in SwiftUI - even in Fall 2021. Apple gives us the possibility to mis-use a TabView with a special modifier in order to create a PageView The modifier is called…
iKK
  • 6,394
  • 10
  • 58
  • 131
2
votes
0 answers

SwiftUI TabView with PageTabViewStyle rotation issues

I am having some issues when rotating a paging TabView. I have the following code: struct ContentView: View { var body: some View { ZStack { Color(.systemGroupedBackground) .edgesIgnoringSafeArea(.all) …
alionthego
  • 8,508
  • 9
  • 52
  • 125
1
vote
0 answers

SwiftUI page tabViewStyle view animation does not work

I am trying to animate on a view’s onAppear method in a tabView, but the next view’s onAppear also executed, when the previous view is just appearing. Seems like the TabView preloads the following page, which triggers the animation before the next…
Wolfer
  • 11
  • 2
0
votes
0 answers

Show partial previous and next item on PageTabViewStyle SwiftUI

I want PageTabViewStyle() to show me a little piece of the previous and next item. I have code like this var body: some View { TabView { ForEach(0..<6) { _ in CustomButton() } } …
0
votes
1 answer

SwiftUI NavigationView + tabView shows navigation title slightly off the screen

I have three views inside of TabView, each with a naviagtionTitle. However, when the first view shows up, the navigationTitle leads almost off the screen. It is only when I click to another page and then back to the original that the navigationTitle…
0
votes
1 answer

SwiftUI Keyboard Not Avoiding in PageTabeViewStyle

I have a very basic onboarding for my app where there are few screens in a tabview with the pagetabviewstyle, and I am having trouble getting the keyboard avoidance behavior to work. If I have have the tabview set with .ignoresSafeArea, then the…
0
votes
1 answer

Getting the out of range index error when trying to make a Page Tab View from API array

This is my Model: class Api { func getRockets(completion: @escaping ([Rocket]) -> ()) { guard let url = URL(string: "https://api.spacexdata.com/v4/rockets") else { return } URLSession.shared.dataTask(with: url) { (data,…
bowtie
  • 29
  • 6
0
votes
1 answer

SwiftUI TabView with tabViewStyle page runs in iOS simulator but crashes on device

I'm trying to create a SwiftUI iOS app with a NavigationLink at the top level, and a TabView detail view, that uses .page, so I can swipe between tabs. And yes, I know the TabView is typically at the top level, with NavigationLink detal. The app…
SDGary
  • 434
  • 3
  • 17
0
votes
0 answers

How to position the control indicators (little dots) of a native SwiftUI PageTabView-styled TabView?

Using iOS14.4.2, Swift5.3.2, Xcode12.4, I am using SwiftUI's new PageTabView-styled TabView (see example-code below). Everything works - except that I would like to move the control-indicators (i.e. little dots) to some other location on the…
iKK
  • 6,394
  • 10
  • 58
  • 131
1
2