Hero: Clip to Bounds is false during transition

Created on 26 Aug 2018  路  10Comments  路  Source: HeroTransitions/Hero

I have a UIView containing other views that are clipped with "Clip to Bounds" is true. But during the transition, all those clipped parts of some views are visible.
Is there a chance to enable clip to bounds during the transition?

Most helpful comment

It seems that I found workaround for this. I've been just randomly checking different modifiers one by one and hooray. It's magic...
I have view that has to be visible outside of parent view bounds during transition. So I added this modifier and it worked. (It should do nothing visually)
cell.partySignImageView.hero.modifiers = [.translate(y: 0)]

I think that it worked because when I say "I want to translate this view inside parent view", hero somewhere is setting clipToBounds to true for parent view. Probably.

All 10 comments

Same problem with UICollectionViewCell subviews during transition

It seems that I found workaround for this. I've been just randomly checking different modifiers one by one and hooray. It's magic...
I have view that has to be visible outside of parent view bounds during transition. So I added this modifier and it worked. (It should do nothing visually)
cell.partySignImageView.hero.modifiers = [.translate(y: 0)]

I think that it worked because when I say "I want to translate this view inside parent view", hero somewhere is setting clipToBounds to true for parent view. Probably.

@julianpomper If you still need this, check it out

@dannydaddy3 I think what @julianpomper wanted is clip subviews those beyond superView's bounds during transition, contrary to your description.

@cuzv oops, you鈥檙e right.
I found couple of issues with this problem, and misunderstood this one.

@julianpomper Did you find a solution for this?

@julianpomper Did you find a solution for this?

@ManueGE No, I used a wrapper

@julianpomper

Can you explain what you did to fix this? Running into the same issue.

Why is the modifier masksToBounds(_:) not doing the job?
Thanks @dannydaddy3 for your workaround. I needed exactly the same thing!
So how is the other way round a problem, since we needed to do something to achieve our goal :D?

I have this issue as well. I have views clipped to bounds but when I apply modifiers they clipping is lost. Curious if there is a way around this beyond my own animation after loading.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PatrykSredzinski picture PatrykSredzinski  路  3Comments

aloisdeniel picture aloisdeniel  路  5Comments

bencallis picture bencallis  路  4Comments

josmanperez picture josmanperez  路  3Comments

imfractured picture imfractured  路  5Comments