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

Fixed button title width bug #9

Merged
merged 1 commit into from
Jun 25, 2021
Merged

Fixed button title width bug #9

merged 1 commit into from
Jun 25, 2021

Conversation

Vortec4800
Copy link
Contributor

Was running into a bug where changing the button title string after the initial layout would cause the button width to not recalculate, and either be too wide or too skinny. This happened most often in reusable table view cells that would redraw for different content, in my use-case the button could say "INSTALL" "DOWNLOAD" or "UPDATE" which require 3 different widths, and scrolling on the list it would get out of sync almost immediately.

Setting the title width back to zero on string didSet causes the width constant to be recalculated on the next layout cycle, which fixes the problem.

@amerhukic
Copy link
Owner

Hi @Vortec4800. I know it's been a long time since you opened the PR, but I only now got some time to review it. Thank you for your contribution.

@amerhukic amerhukic merged commit cd0fc96 into amerhukic:master Jun 25, 2021
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

Successfully merging this pull request may close these issues.

None yet

2 participants