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

BadgeView does not seem to resize depending on content #17

Open
ghost opened this issue Nov 20, 2017 · 6 comments
Open

BadgeView does not seem to resize depending on content #17

ghost opened this issue Nov 20, 2017 · 6 comments

Comments

@ghost
Copy link

ghost commented Nov 20, 2017

Xcode 9.1 /Swift 4

Is it intendet that the badgeView does not resize dynamically regarding its content?

I would expect a widget to do that

@evgenyneu
Copy link
Owner

Hello @camdata, the badge should resize to according the size of the text. If it doesn't then there must be a bug. Can you tell me about your issue?

@ghost
Copy link
Author

ghost commented Nov 21, 2017 via email

@evgenyneu
Copy link
Owner

Thanks for the workaround. I would like to know why the badge does not resize in the first place. As you probably noticed, the badge is just a UILabel. Therefore, it should resize itself automatically. It should not require setting its size explicitly.

Can you describe your use case, so we can fix the problem?

  1. How do you use and position the badge?
  2. When do you update it?
  3. Do update the badge from the main queue?

@ghost
Copy link
Author

ghost commented Nov 21, 2017 via email

@evgenyneu
Copy link
Owner

evgenyneu commented Nov 21, 2017

I could not reproduce your problem. I've made a demo app with a badge and a stepper that changes the number. The badge autoresize automatically, when "Lines" property is 1 (which is default) and 0.

Do you update the badge number in the main queue?

Please find the demo attached.

DemoBadge.zip

@vin047
Copy link

vin047 commented Sep 28, 2021

You can also use sizeToFit() after setting the title.

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

2 participants