facebookarchive / Shimmer

An easy way to add a simple, shimmering effect to any view in an iOS app.
Other
9.35k stars 1.11k forks source link

Issues when used with views inside of UIStackView #73

Open jyounus opened 7 years ago

jyounus commented 7 years ago

Hey there,

It seems like Shimmer doesn't work well with UIStackViews.

Here's what it's supposed to look like (this is without Shimmer added): https://abload.de/img/simulatorscreenshot15hokh1.png

Here's a screenshot of what happens when I add the Shimmer effect to the small grey view at the bottom: https://abload.de/img/simulatorscreenshot15x1kkz.png

The view hierarchy itself is very simple.

Cell View (grey coloured)
--UIStackView (white coloured)
----View (pink coloured)
----View (grey coloured)

I've got another similar view in my project which doesn't use a UIStackView and it works fine there (except from the fact that it's messed up when I rotate the device, but that's a different issue).

grp commented 7 years ago

I'd try wrapping another view around the shimmer view so the stack view doesn't modify it.

Otherwise, I'd suggest debugging what properties the stack view sets on the view. If you can replicate that in a test case that shows what properties cause incorrect layout, can take a look at that.