Popovers
Popovers copied to clipboard
Question: How can i get this to work for a tabview item?
I've tried placing the .popover in several places on the tab view but i can't seem to get it to show. I am trying to get the popover with the "arrow" down to appear over a tab so i can "show" users what to do in my app.
Here is a snippet of my code, this is my most recent attempt:
TabView(selection: $selectedTab) { HomeView(showPopup: $showWelcomePopup) .tabItem { Label("Home", systemImage: "house") } .tag(0) AnimalListView(showHatchingView: $showHatchingView, refreshList: $refreshAnimalList) .tabItem { Label { Text("My Animals") } icon: { Image(systemName: "hare") } } .popover( present: $showAnimalsPopup, attributes: { $0.sourceFrameInset.top = -8 $0.position = .absolute( originAnchor: .top, popoverAnchor: .bottom ) } ) { Templates.Container( arrowSide: .bottom(.mostClockwise), backgroundColor: .green ) { Text("This is a pretty standard-looking popover with an arrow.") .foregroundColor(.white) } .frame(maxWidth: 300) } .tag(1) }