Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with UIStackView #23

Closed
robinkunde opened this issue Dec 7, 2017 · 8 comments
Closed

Problem with UIStackView #23

robinkunde opened this issue Dec 7, 2017 · 8 comments

Comments

@robinkunde
Copy link

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

@Juanpe
Copy link
Owner

Juanpe commented Dec 18, 2017

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.

@jmjordan
Copy link

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

@weiran
Copy link

weiran commented Mar 30, 2018

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

@ZachOrr
Copy link

ZachOrr commented Jun 4, 2018

One workaround is to wrap your labels in a UIView. It's subpar (I'm seeing #64 with this approach), but it gets you most of the way there.

@hactar
Copy link

hactar commented Jun 25, 2018

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

PrepareForSkeletonProtocol.swift:17

text = " "

@giantramen
Copy link
Contributor

giantramen commented Jun 26, 2018

Submitted a pull request to fix this.
#73

Juanpe added a commit that referenced this issue Jun 26, 2018
fix: UIStackView Label Issue #23
@Juanpe
Copy link
Owner

Juanpe commented Jul 24, 2018

Could you check if this bug is solved?
Thanks!

@robinkunde
Copy link
Author

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.

@Juanpe Juanpe closed this as completed Jul 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants