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

Titles can get cut off, make font size adjust automatically. #45

Closed
dannymout opened this issue Feb 5, 2017 · 4 comments
Closed

Titles can get cut off, make font size adjust automatically. #45

dannymout opened this issue Feb 5, 2017 · 4 comments

Comments

@dannymout
Copy link

dannymout commented Feb 5, 2017

I'm having an issue, on some devices, the titles can get cut off, and the rest is replaced with three dots. If width is limited, can the font size automatically become smaller to compensate? UILabels already are able to do this, there is an option in Storyboards.

@dannymout
Copy link
Author

dannymout commented Feb 5, 2017

I've tested titleLabel.adjustsFontSizeToFitWidth = true and it does indeed work, but it causes all the labels to have different font sizes. Anyway you could take the title with the largest amount of characters, grab it's font size, and use it for the other titles? @gmarm @LukeDurrant @calissendorff @Ewg777

@gmarm
Copy link
Owner

gmarm commented Feb 6, 2017

Hey @dannymout thanks for pointing this issue out!

A quick solution would be to add a property that sets the adjustsFontSizeToFitWidth property of the title labels, however your last proposal makes more sense I think. I don't think it works best by using the character count, some characters take more space than others.

I'll definitely look into this soon!

@dannymout
Copy link
Author

@gmarm Do you know what a solution might be, I might be able to fix it.

@gmarm
Copy link
Owner

gmarm commented Apr 3, 2017

Hey @dannymout sorry for the delay.

What is needed here is a way to find the minimum font size amongst all titles and then set it to all the titles so there is a consistent look. I haven't looked into the best way to achieve the first goal. You can have a look into it if you want.

However, this PR: #47, merged recently, might work around the issue.

This doesn't mean of course that adding this feature wouldn't be nice.

@gmarm gmarm closed this as completed Oct 12, 2017
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