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
CardView doesn't center pure textural content #355
Comments
The nibs are intended to supply basic form factors only. Supporting all of the permutations of form factor and content wouldn't be practical IMO. The nibs are provided so you can copy them into your project and easily modify them to suit your specific needs. In any case, I'm fine with changing the alignment to |
Hi @wtmoose ! Yeah, you are right - the docs emphazise that you should copy the xibs and use them as templates. However, I found it strange (and a little wrong hehe) that the text is left-aligned if it's short, but centered if it's longer and spans over several lines. If |
I put a fix for this on the head of |
Sorry for the slow reply, we’ve been busy at work. Great, I’ll try it and see if it works :) |
Hi @wtmoose i tried to center the body text (not using any other element) and it worked if I copy the framework manually, any plans to release this in cocoapods? thanks! |
Same question as above, thank you. |
Same issue, still waiting for new release which fixes this. Until then, if you don't want to copy and edit the xib, just use this (a little ugly) fix: if let stackView = view.titleLabel?.superview as? UIStackView {
stackView.alignment = .fill
} |
Included in 8.0.0 release |
We use
CardView.xib
to display a pure text message, without an icon, title or button. We set the body label's text alignment tocenter
, since we want the text centered in the card.The problem is that the content is only centered when the text is long enough to wrap over two lines. We can fix this by opening
CardView.xib
and setAlignment
toFill
for the vertical, innermost stack view.We considered a couple of ways this could be done, but ended up in that it would be nice to have a "pure text card" view, for which the content is centered. We will add such a xib to our project now, but it would be nice if the library could include such a xib as well.
The text was updated successfully, but these errors were encountered: