如何解决如何在Objective-C中添加“ ...更多”点击动作UILabel
@property (strong,nonatomic) IBOutlet MDHTMLLabel* customMessageLabel;
我已经使用MDHTMLLabel呈现HTML字符串。
_customMessageLabel.delegate = self;
[_customMessageLabel sizeToFit];
_customMessageLabel.verticalAlignment = MDHTMLLabelVerticalAlignmentCenter;
_customMessageLabel.linkAttributes = @{ NSForegroundColorAttributeName: [UIColor blueColor],NSFontAttributeName: [UIFont boldSystemFontOfSize:_customMessageLabel.font.pointSize],NSUnderlineStyleAttributeName: @(NSUnderlineStyleSingle) };
_customMessageLabel.activeLinkAttributes = @{ NSForegroundColorAttributeName: [UIColor redColor],NSUnderlineStyleAttributeName: @(NSUnderlineStyleSingle) };
_customMessageLabel.htmlText = @"Welcome to clickable link clickable link - <a href='http://store.apple.com'>link to apple store</a> <a href='http://www.google.com'>link to google</a> <a href='http://www.yahoo.com'>link to yahoo</a> <a href='https://github.com/honcheng/RTLabel'>link to RTLabel in GitHub</a> <a href='http://www.wiki.com'>link to wiki.com website</a> NSAttributtedString have a property string and it is read only property you can not change it NSAttributtedString have a property string and it is read only property you can not change it NSAttributtedString have a property string and it is read only property you can not change it";
_customMessageLabel.truncationTokenString = @"...More";
_customMessageLabel.truncationTokenStringAttributes = @{
NSForegroundColorAttributeName:[UIColor redColor],NSFontAttributeName:_customMessageLabel.font,NSUnderlineStyleAttributeName: @(NSUnderlineStyleSingle),};
如何在目标C中提供更多(...更多)点击操作。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。