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

Long text break message and have extra margins #72

Closed
Ganzolo opened this issue Aug 16, 2017 · 4 comments
Closed

Long text break message and have extra margins #72

Ganzolo opened this issue Aug 16, 2017 · 4 comments
Milestone

Comments

@Ganzolo
Copy link

Ganzolo commented Aug 16, 2017

Hi,

When I try to input very long messages I get an extra margin at the top and the bottom of each bubbles.

simulator screen shot 16 aug 2017 14 32 42

After investigating I realised that if I change in MessagesCollectionViewFlowLayout.Swift (line 64) :

messageLabelFont = UIFont.preferredFont(forTextStyle: .body)

by

messageLabelFont = UIFont.systemFont(ofSize: 17) // This is the font used anyway in my UILabel

simulator screen shot 16 aug 2017 14 36 21

It works. Hope this helps.

Best regards,

@Ganzolo Ganzolo changed the title Long text break have extra margins Long text break message and have extra margins Aug 16, 2017
@AndrewLauder
Copy link

Is this a valid issue? If so, @Ganzolo, care to do a PR, or would you like me to do that?

@SD10
Copy link
Member

SD10 commented Aug 17, 2017

@Ganzolo Are you changing the font for the MessageLabel? It should use the same font provided in the MessagesCollectionViewFlowLayout.

@AndrewLauder I haven't looked into this so I don't know if it's a bug or not. Looks like something is off though. I hope to review it in a bit.

@Ganzolo
Copy link
Author

Ganzolo commented Aug 17, 2017

@SD10

I did not and I used the same font as the default one in UILabel. It's a very strange issue but it might be related to AutoLayout + preferredFont method.

Here is a person also having trouble with this :

https://stackoverflow.com/questions/34983275/uitext-view-is-getting-randomly-clipped-when-using-autolayout-and-or-preferredfo

@AndrewLauder
My quick fix of hard coding default font size is not good. If you confirm the issue, we need to get rid of preferredFont method. I'll let u do PR then.

Best regards

@SD10
Copy link
Member

SD10 commented Aug 18, 2017

@Ganzolo Do you know which release of the project you're using? I think I've resolved this in v0.5.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants