Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: How can i get this to work for a tabview item? #71

Open
jforward5 opened this issue Feb 8, 2023 · 0 comments
Open

Question: How can i get this to work for a tabview item? #71

jforward5 opened this issue Feb 8, 2023 · 0 comments

Comments

@jforward5
Copy link

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) }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant