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

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

Open
tciuro opened this issue Apr 30, 2017 · 2 comments
Open

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

tciuro opened this issue Apr 30, 2017 · 2 comments

Comments

@tciuro
Copy link

tciuro commented Apr 30, 2017

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!

weijentu added a commit that referenced this issue May 3, 2017
@weijentu
Copy link
Owner

weijentu commented May 3, 2017

@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,

@tciuro
Copy link
Author

tciuro commented May 3, 2017

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

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