-
-
Notifications
You must be signed in to change notification settings - Fork 227
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
sizeToFit not implemented #92
Comments
@Pe-te Yes, you're right. |
Take your time, guess that's a tricky one! For now I am using a workaround with onDidChangeHeightTo where I store the value in a global variable, but that feels really messy, so a clean solution would be very welcome. |
Cool, will check first thing monday morning! I'm not using insets, but don't you need to subtract left and right from the width? I could be wrong though, haven't looked at the code in detail yet. |
@Pe-te That's a good point. Does the |
You mean the UILabel titleLabel in my example above? I'm not setting any insets there, so it has the default insets. But it looks like you cannot just modify label insets by default anyway. For WSTagsField I use the following insets. Works as expected, thanks!
I also tried adding contentInsets for top and buttom, those work fine, even when you add like 40 tags. But there are problems when you try to set left and right insets. For those the sizeToFit().height is way too large. This happens already with small amounts like 2-3 tags, but gets a lot worse for bigger amounts. Maybe an inverted sign? I gave the view a backgroundcolor and it looks fine as expected, all paddings are applied correctly. Just sizeToFit() is acting weird. Best guess: First all paddings need to be removed, then size calculation on the smaller canvas, then adding all four paddings again. |
@Pe-te Thanks for the feedback. I'll look at it. |
Hi, I'm trying to calculate the height the WSTagsField needs in my view, any way to get that easily? I tried using sizeThatFits, but it seems not implemented and is returning 0:
The text was updated successfully, but these errors were encountered: