optonaut / ActiveLabel.swift

UILabel drop-in replacement supporting Hashtags (#), Mentions (@) and URLs (http://) written in Swift
MIT License
4.47k stars 686 forks source link

AutoLayout Not Working Correctly with ActiveLabel #36

Closed ghost closed 8 years ago

ghost commented 8 years ago

I'm using ActiveLabel as the Custom Class for my post’s content labels in the Storyboard; however, I believe it is interfering with Autolayout. For some reason the post’s content gets cut off (screenshot attached).

I guess it’s hard to know without seeing my code - but do you have a clue why this might be?

img_1008

polqf commented 8 years ago

Sorry, I cannot understand your problem. Do you mean that the text gets cut of on the right side of the cell?

hdogan commented 8 years ago

It breaks sentences as seen on screenshot. (As seen on first cell on screenshot "Palmer is throwing down tonight at 11pm. Theme").

I've tested with using "HelveticaNeue" font on custom table cell. But when I switch another font (tested with Avenir Next and San Francisco) it works as expected.

OmerCora commented 8 years ago

setting the line count of the label to "0" fixed this issue for me but i am having some auto-layout issues too, my dynamic cell height cant properly calculated.

hdogan commented 8 years ago

Labels' numberOfLines values are already set 0 when testing.

MBLESSEN commented 8 years ago

I'm having the same problem anyone figure this out?

EDIT* i switched my custom font to system font and it corrected the problem of text being cut off.

this needs a fix

MBLESSEN commented 8 years ago

Does anyone have a fix for custom fonts and auto layout? any ideas on how to fix this i the source code?

iantheparker commented 8 years ago

+1

alkanyunus commented 8 years ago

Yes I've also had this issue. I had to make my label's font to System. Font style doesn't work either.

polqf commented 8 years ago

Hi guys, merged #46 . Please check if this is issue is fixed with it and let me know :wink: