The dashboard animation does show when it's loaded first on the page, but does not show the animation when I click from products to dashboard. They both work in the same way, with a v-if and a :class when the button is clicked, it will add the animation class. But when I click back on the productsPageBtn is does work again and shows the animation again. When I click on the dashboard (the default) it does not show the animation. When the user clicks on the button with the it shows the animation. I'll use the example below to simplify my problem. Specifically, what I want it to do, is when a button is clicked, the page will show and a fade-up animation will show every time I switch between pages. The expected result is when the user click on a button, it will show a certain div with the page content, and it will show a fade up animation. additionalSafeAreaInsets since its not necessary at all! And I've no idea why I thought I needed it in the first place.Ĭurrently, using the latest version of Vue.js in my Laravel application. That way the layout calculations for the animation get correct, and the correct safe area is set.īelow is the code for my custom UIViewControllerTransitioningDelegate with the workaround. Since UIViewControllerTransitioningDelegate.animationController(forDismissed.) is called right before UIViewController.viewWillDisappear and UIViewControllerAnimatedTransitioning.animateTransition(using transitionContext.), I start the dismiss animation already in that method. My current workaround is somewhat hacky, but it gets the job done. additionalSafeAreaInsets is ignored (since these insets modifies the safe area of the view controller's view). In short, it looks like the safe area is not updated after UIViewController.viewWillDisappear is called, and hence any changes to. The code for the custom UIViewControllerTransitioningDelegate is provided below.Īfter some debugging I managed to find a workaround to this problem. But UIKit/Auto Layout use these properties when calculating the frames)Īny thoughts on how to battle this issue is great welcome! (I'm quoting "animates", since its actually the view's frame that is animated. So that the effective safe area starts at 0 and "animates" to the expected value during presentation, and starts at expected value and "animates" to 0 during dismissal. So, what I want is: use additionalSafeAreaInsets to diminish the effect of the safe area during animation, by setting additionalSafeAreaInsets to the "inverted" values of the safe area. The red box is the safe area (plus some padding) of the presented view - which I'm trying to compensate for during animation, using the additionalSafeAreaInsets property of the view controller owning the view.Īs the gif shows, the safe area is properly adjusted during presentation but not during dismissal. It looks like this property is not accounted for when I'm trying to animate the dismissal of the view controller and its view. And it works great! Except when I try to adjust the additionalSafeAreaInsets of the view controller owning the view during dismissal. Im doing this by creating UIViewControllerAnimatedTransitioning-objects that animate the presented view's frame. I've created a custom UIViewControllerTransitioningDelegate that I use to animate a view from one view controller, to full-screen in another view controller.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |