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

take care of too long text for title #146

Open
fukemy opened this issue Nov 20, 2018 · 4 comments
Open

take care of too long text for title #146

fukemy opened this issue Nov 20, 2018 · 4 comments

Comments

@fukemy
Copy link

fukemy commented Nov 20, 2018

screen shot 2018-11-20 at 17 48 17

@StriderHND
Copy link

Did you find a way to handle this?

@fukemy
Copy link
Author

fukemy commented Nov 22, 2018

i trim text if over 15 length
screen shot 2018-11-22 at 10 37 20

func setMenuTitle(_ title: String) {
        if title.count > 16 {
            let temp = "\(String(title[String.Index(encodedOffset: 0)...String.Index(encodedOffset: 16)])).."
            self.menuTitle.text = temp
        }else {
            self.menuTitle.text = title
        }
        self.setNeedsLayout()
    }

@PhamBaTho
Copy link
Owner

I think I will provide the method to truncate long text (head/middle/tail). Thanks for raising the issue.

@Navoda-BrightSparks
Copy link

is this issue fixed?

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

4 participants