Skeletonview: Problem with UIStackView

Created on 7 Dec 2017  ·  8Comments  ·  Source: Juanpe/SkeletonView

What did you do?

I have a UIStackView that contains several labels. I called showSkeleton() on all the labels.

What did you expect to happen?

Each label shows up skeletonized.

What happened instead?

Because SkeletonView sets the text of each label to nil, UIStackView sets the height of each label to 0 and lays them out on top of each other.

SkeletonView Environment

SkeletonView version:
1.0.4
Xcode version:
9.2
Swift version:
4

✅ fixed 🐞 bug

All 8 comments

Hi @robinkunde, sorry for the delay in the answer. I've checked this behaviour and you're right, it's a bug. So, I'm going to add this bug in the backlog and I'm going to try to fix as soon as possible.

I am also having this issue. Are there any updates?

@jmjordan my workaround for UITableViews is to have a skeleton cell prototype that doesn't use UIStackView and show that instead.

One workaround is to wrap your labels in a UIView. It's subpar (I'm seeing https://github.com/Juanpe/SkeletonView/issues/64 with this approach), but it gets you most of the way there.

I've worked around this issue by not setting the text to nil but setting it to " " instead.

PrepareForSkeletonProtocol.swift:17

text = " "

Submitted a pull request to fix this.
https://github.com/Juanpe/SkeletonView/pull/73

Could you check if this bug is solved?
Thanks!

Sorry, I'm not using SkeletonView at the moment, but I looked at the diff at that should take care of it. You can close the issue if that works for you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kak2008 picture kak2008  ·  4Comments

jamesTheKid picture jamesTheKid  ·  4Comments

ghost picture ghost  ·  7Comments

raphaklr picture raphaklr  ·  5Comments

macistador picture macistador  ·  6Comments