Questions tagged [tabview]

Any visual layout that incorporates selectable tabs as an organizational element.

770 questions
3
votes
1 answer

SwiftUI Tabview Fix

On my app, I have a tab view. 4 of the tabs are blank pages. No lists or anything. One of them has a list and makes the tab bar translucent because of the scroll function. The problem is, whenever I navigate away from the list page, the translucent…
Canyon
  • 45
  • 6
3
votes
1 answer

SwiftUI: Tabview Repeating itself

I'm trying to create a tabview for a macOS 10.15 app. TabView { BookmarksView() .tabItem { Text("Bookmark Settings") } DisplaySettings() .tabItem { Text("Display Settings") …
Eric
  • 673
  • 1
  • 7
  • 23
3
votes
0 answers

Android tab activity View visibility change event

What is the event dispatched to a View when its visibility changes? I have a custom View that is attached to a tab. When my custom View becomes invisible because the user switches to other tabs, I want my custom View to be informed.
harry lee
  • 31
  • 2
3
votes
6 answers

First tab bar button appears twice when using TabView in SwiftUI

As you can see from the screenshot, the 'Language' tab appears twice. I've got the following code for HostingTabBar which is called on app startup: struct HostingTabBar: View { private enum Tab: Hashable { case language …
Tirna
  • 383
  • 1
  • 12
3
votes
1 answer

How SwiftUI TabView Page handles big data

I use TabView to browse albums because I need a paging function, but my album has thousands of pictures, and TabView is very slow to process. Is there any way to lazy loading so that TabView can handle thousands of data. TabView(selection:…
gaohomway
  • 2,132
  • 1
  • 20
  • 37
3
votes
1 answer

Element on TabView does not disappear after being deleted

I have this class: class PageViewModel:ObservableObject { @Published var cars = [Car]() func delete(_ car:Car) { cars = cars.filter { $0 != car } } } Then I pass this class to a view called PageView, like this @ObservedObject…
Duck
  • 34,902
  • 47
  • 248
  • 470
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
3
votes
3 answers

Bidirectional infinite PageView in SwiftUI

I'm trying to make a bidirectional TabView (with .tabViewStyle(PageTabViewStyle(indexDisplayMode: .never))) whose datasource will change over time. Below is the code that describes what is expected in the result: class TabsViewModel:…
Asio Otus
  • 71
  • 6
3
votes
1 answer

Change Tabview color based on which tab is selected -Swiftui

I am trying to see if I can make the color of the bottom tabview change depending on which tab item is selected. Currently I can make the tabview bar clear with the below code in the init. let tabBar = UITabBar.appearance() init() { …
Kenji
  • 33
  • 1
  • 4
3
votes
1 answer

Add a badge value in SwiftUI in a simple way for a TabView tabItem

Is it possible to add a badge value in SwiftUI in a simple way for a TabView tabItem? Like this (normal Swift here) : import UIKit class TabBarController: UITabBarController { override func viewDidAppear(_ animated: Bool) { …
Flincorp
  • 751
  • 9
  • 22
3
votes
3 answers

SwiftUI Disable specific tabItem selection in a TabView?

I have a TabView that presents a sheet after tapping on the [+] (2nd) tabItem. At the same time, the ContentView is also switching the TabView's tab selection, so when I dismiss the sheet that is presented, the selected tab is a blank one without…
Steven Schafer
  • 834
  • 3
  • 10
  • 24
3
votes
2 answers

Hiding tab bar on a specific page in SwiftUI

I am working with a camera in my application. The app allows you to navigate to this camera view with the help of the TabView in SwiftUI. However, the problem is, when I am on the camera view, I would like to make the TabView hidden. So far I've…
Kymani
  • 45
  • 1
  • 6
3
votes
1 answer

SwiftUI how TabView is implemented underneath

I consider how TabView in SwiftUI has been implemented. As I can see it takes in such just @ViewBuilder with content into initializer. public init(selection: Binding?, @ViewBuilder content: () -> Content) I would like to implement…
Michał Ziobro
  • 10,759
  • 11
  • 88
  • 143