Hi There,
Firstly, love the library - amazing job.
Hero seems to be reordering layers depending on whether a view appears at the end of the transition or not.
I've created a quick example (excuse the poor code) here . You'll notice the 'Previous' button is being covered by the animating background.
Any suggestions would be great.
Steve
I have the same problem currently. I set the heroModifier zPosition to 0, but I can't see any changes
@Sn0wfreezeDev did you ever find a solve by chance?
My solution was to set the alpha of the overlaying buttons to 0.0 and when the animation is completed animate the buttons in after that.
The problem is that it took longer until everything was shown, but I guess in my setup it's almost impossible to animate the image into the correct position without overlaying the buttons.
Cheers,
Alex
Try adding the .useGlobalCoordinateSpace modifier to the views being obscured.
@leeprobert my DUDE! Wasted half my day before trying .useGlobalCoordinateSpace. Thanks!
Does not help with issue #454
I use this piece of code, and works great:
extension HeroModifier {
static var bringToFront: HeroModifier {
return zPositionGlobal(CGFloat.greatestFiniteMagnitude)
}
static func zPositionGlobal(_ zPosition: CGFloat) -> HeroModifier {
return HeroModifier(applyFunction: { (targetState) in
targetState.coordinateSpace = .global
if targetState.beginState == nil {
targetState.beginState = []
}
targetState.beginState!.append(.zPosition(zPosition))
})
}
}
Most helpful comment
Try adding the .useGlobalCoordinateSpace modifier to the views being obscured.