GithubHelp home page GithubHelp logo

Comments (14)

lkzhao avatar lkzhao commented on July 24, 2024

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.

UberJason avatar UberJason commented on July 24, 2024

Awesome, that helps and also helps me understand the zPosition modifier better. Thank you!

from hero.

EthanSchatzline avatar EthanSchatzline commented on July 24, 2024

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.

UberJason avatar UberJason commented on July 24, 2024

How about the target imageView? I think properties have to be set on the target controllers to work.

from hero.

EthanSchatzline avatar EthanSchatzline commented on July 24, 2024

@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.

UberJason avatar UberJason commented on July 24, 2024

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.

lkzhao avatar lkzhao commented on July 24, 2024

@UberJason You are completely right! We should include this in the usage guide.

from hero.

EthanSchatzline avatar EthanSchatzline commented on July 24, 2024

@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.

lkzhao avatar lkzhao commented on July 24, 2024

Should be good enough. Try it and let us know.

from hero.

UberJason avatar UberJason commented on July 24, 2024

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.

EthanSchatzline avatar EthanSchatzline commented on July 24, 2024

@UberJason @lkzhao awesome. Thanks for the help guys. I'll let you know how it goes.

from hero.

EthanSchatzline avatar EthanSchatzline commented on July 24, 2024

@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.

lkzhao avatar lkzhao commented on July 24, 2024

@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.

UberJason avatar UberJason commented on July 24, 2024

Awesome, that sounds useful!

from hero.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.