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

设置lable文字居中的话,就不能响应点击了。。。 #22

Open
yx920609 opened this issue Mar 7, 2018 · 1 comment
Open

Comments

@yx920609
Copy link

yx920609 commented Mar 7, 2018

刚才试了半天,这个只能设置文字居左,居中的话,还要自己另外算偏移吗?

@lyb5834
Copy link
Owner

lyb5834 commented Nov 22, 2018

必须这样设置

      NSMutableParagraphStyle *sty = [[NSMutableParagraphStyle alloc] init];
     sty.alignment = NSTextAlignmentCenter;
     [attributedString addAttribute:NSParagraphStyleAttributeName value:sty range:NSMakeRange(0, text.length)];

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