automatic-height-tagcells icon indicating copy to clipboard operation
automatic-height-tagcells copied to clipboard

The tag is chopped if it's wider than the width of the display

Open tciuro opened this issue 7 years ago • 2 comments

If you have a long enough string, the tag's right side will be chopped off. Consider filling the tag as much as the display's width and add an API to allow to set the ellipsis (using NSLineBreakMode). Something like:

 /* An initialization sample of AHTag with Objective-C */
AHTag *tag = [AHTag new];
tag.category = @"Genre";
tag.title = @"This is a really, really long string that probably won't fit in the tag";
tag.color = [UIColor colorWithRed:1 green:0.56 blue:0.56 alpha:1];
tag.url = [NSURL URLWithString:@"http://www.coldyam.com"];
tag.enabled = @YES;
tag.lineBreakMode = NSLineBreakByTruncatingMiddle;

That would make the tag look great. Thank you!

tciuro avatar Apr 30 '17 05:04 tciuro

@tciuro It's surprising to me that the issue is more complicated than I thought. During my workaround, I had a weird drawing results in tags. Anyway, I take an experimenting approach in the branch: TruncatingTail to solve the issue. Because I'm not very satisfied in the approach, I'll put it as a branch until I can get a better solution.

Cheers,

weijentu avatar May 03 '17 02:05 weijentu

I tried to fix it, but started to go down the proverbial rabbit hole. Thanks for trying to address it!

tciuro avatar May 03 '17 04:05 tciuro