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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Card stack layout with flip card #387

Closed
erossini opened this issue Oct 31, 2023 · 4 comments
Closed

Card stack layout with flip card #387

erossini opened this issue Oct 31, 2023 · 4 comments

Comments

@erossini
Copy link

Hi,
I'm looking at your code for the card stack layout and it is almost what I'm looking for 馃榿

Basically, I'm learning MAUI and I want to create an app with flash cards. So, I arrived at the point where I display the cards.

image

Now, the problems I'm facing are:

  • in the CardView I tried to change the Content but I get an error (Java.Lang.IllegalStateException: 'The specified child already has a parent. You must call removeView() on the child's parent first.', different in Windows)
  • if I add in the CardView a TapGesture, the SwipeGesture or PanGesture are not effected the view, although they are fired.
var tapGesture = new TapGestureRecognizer();
tapGesture.Tapped += TapGesture_Tapped;
GestureRecognizers.Add(tapGesture);

Do you have any advice or code for that? Thank you in advance,
Enrico

@VladislavAntonyuk
Copy link
Owner

  1. You can search for this issue in dotnet/MAUI repo. I saw it on Android. You cannot replace/reuse content.
  2. What do you mean by not affecting?

@erossini
Copy link
Author

erossini commented Nov 3, 2023

I put together a project as an example of the issue. You can find the project here https://github.com/erossini/MauiCardLayout

@VladislavAntonyuk
Copy link
Owner

@erossini from what I see PanGesture is executed and cards disappear and appear. TapGesture is executed as well and card flips. As for SwipeGesture, it is a known .NET MAUI issue.
You can see that CardView (CardLayout) already has a PanGesture:
var panGesture = new PanGestureRecognizer();
panGesture.PanUpdated += PanGesture_PanUpdated;
GestureRecognizers.Add(panGesture);

@VladislavAntonyuk
Copy link
Owner

Updated sample with some animations and tweaks

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

2 participants