Comments (14)
If you turn on the debug plugin and turn on the 3D view. You will see why.
Hero cannot infer the correct zOrder of all the views. It currently always put destination views on top of the source views. The white background is animating faster than your black square therefore it is covering it at the start of the animation. You can use the zPosition modifier to manually adjust the zOrder. I.e. Give the black square a higher zPosition.
from hero.
Awesome, that helps and also helps me understand the zPosition modifier better. Thank you!
from hero.
Hey @lkzhao I am having the same issue. I just started messing around with the library so I'm probably doing something wrong.
I have 2 viewcontrollers with an imageview and white backgrounds.
I set both imageView's heroIDs to the same string
I set the source imageView's heroModifier to [.zPosition(5)]
both viewControllers have enabled Hero
present the second viewController from the first
But the imageView flashes before starting the transition. Any idea?
from hero.
How about the target imageView? I think properties have to be set on the target controllers to work.
from hero.
@UberJason What heroModifiers would I need to give the target imageView? Currently I am just setting zPosition to 5 on the source imageView and not setting any heroModifiers on the destination imageView. The only thing I set on the destination controller is the heroID on the destination imageView, and enabling Hero on the viewcontroller.
from hero.
Try setting the zPosition on the source and target imageView. I think that would ensure the transition avoids the flash in both directions (present and dismiss). When you present the view controller, it'll look at the target controller's zPosition to decide (which is the presented view controller); when you dismiss the view controller, the target view controller is the presenting view controller. Note, I haven't actually tried this situation, so let me know if I'm totally wrong, @lkzhao.
from hero.
@UberJason You are completely right! We should include this in the usage guide.
from hero.
@UberJason @lkzhao I will try this tonight! I feel like I tried that last night though and it didn't work. Will see what happens though. I'm not missing anything else am I? I only set heroIDs for the 2 imageViews and enabled Hero on the VCs and did nothing else hero-related to anything else, no heroID on the viewcontrollers' view. (Other than setting zPosition heroModifier to the imageViews).
from hero.
Should be good enough. Try it and let us know.
from hero.
I think that was all that I did. Feel free to clone my project that I referenced in my original issue post and look at it to compare with yours.
from hero.
@UberJason @lkzhao awesome. Thanks for the help guys. I'll let you know how it goes.
from hero.
@UberJason @lkzhao Jason, I messed around with your sample project. Spiced it up a bit, and man this is a pretty cool library. Anyway, I got home and tried running it on my device and there was no flicker. It was just in the simulator... tisk tisk. Thanks guys!
from hero.
@here Just pushed a new version 0.1.8 which eliminated the need for zPosition modifier to be used in most cases. Hero will try to determine the order from the view hierarchy.
from hero.
Awesome, that sounds useful!
from hero.
Related Issues (20)
- Animation not working for UICollectionViewDiffableDataSource HOT 1
- Request: Make HeroTransition::complete(after: TimeInterval, finishing: Bool) public
- Version 1.6.2 doesn't work with SPM HOT 16
- <Hero/Hero-Swift.h> file not found when I use “ pod 'Hero' ”.
- Animation doesn't work when navigationController pushing screen HOT 4
- OverFullScreen problem HOT 3
- HeroModifiers will fail when a nested `when` modifier exist
- 在tabbar控制器嵌套的navigation控制器中push进子页面,tabbar的显示/隐藏没有任何动画 HOT 2
- hero push animation is unable to turn off
- How do I keep the tabbar is not hidden when push
- Doesn't the demo project work? HOT 2
- Spring Modifier on dismiss view controller Hero.
- hidesBottomBarWhenPushed bug
- Demo cant be run.
- need help, match hero animation across multiple preseting viewcontollers HOT 1
- Default source code, why is there a black area at the top? HOT 2
- Black screen when removing VC
- CI/CD github action needs update to newer env
- Privacy Manifest HOT 1
- Library not loaded HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hero.