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 spacing when embedded in UIStackView #29

Open
avf opened this issue Dec 29, 2015 · 3 comments
Open

Problem with spacing when embedded in UIStackView #29

avf opened this issue Dec 29, 2015 · 3 comments

Comments

@avf
Copy link

avf commented Dec 29, 2015

There seems to be a problem with setting the spacing to a value below 5 when the control is embedded in a UIStackView.

To reproduce this:

  • Open the demo and delete all the constraints in the main storyboard.
  • Select all the views and embed them in a stackview.
  • Constrain the stackview to the edges
  • Let IB auto-fix the hugging priorities
  • Select the topmost HCSStarRatingView and set the spacing to something below 5
  • You will see that the rendering is screwed up in interface builder

Now, when you build and run, it will actually draw correctly in the demo project, but in my own project, it won't, the spacings will be incorrect. I'm not entirely sure if this is really a problem on my side, but I think it's got something to do with the way intrinsicContentSize is calculated. Since you're pinning the height to 44, the spacing will always be incorrect when you constrain the view to a different height.

@hsousa
Copy link
Owner

hsousa commented Nov 5, 2016

Hi @avf! Did you find a solution to this?

From my experience, UIStackView should be doing the right thing (which is why it works in the demo project 😆).

Have you checked your constraints and content compression resistance priority? If something else inside the stack view has a higher CCRP than the rating view bad stuff might happen 😜

@menaweb
Copy link

menaweb commented Jan 9, 2017

Hi @avf, I have the same problem when embedded in UIStackView. My solution was add an aspect ratio constraint to the view and the spacing problem was fixed.

@hsousa
Copy link
Owner

hsousa commented Jan 9, 2017

Thanks @menaweb and @avf. I'll take a look as soon as I have some time to see what might be going on. 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants