Closed danielsaidi closed 4 years ago
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 Fill
. Did you foresee an issue with that?
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 fill
solves the problem, that'd be great. I haven't tried the combo icon + text + fill + button, so I'm not sure if it causes any other side-effects.
I put a fix for this on the head of master
if you want to try it. Will release soon.
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.