[selfsetEdgesForExtendedLayout:UIRectEdgeNone];
[selfsetExtendedLayoutIncludesOpaqueBars:YES];
[selfsetModalPresentationCapturesStatusBarAppearance:YES];
貌似可以实现自适应高度,不行,待删除
- (NSMutableAttributedString *)filterLinkWithContent:(NSString *)content {
NSMutableAttributedString *attributedString = [[NSMutableAttributedStringalloc]initWithString:content];
NSError *error =NULL;
NSDataDetector *detector =
[NSDataDetectordataDetectorWithTypes:(NSTextCheckingTypes)NSTextCheckingTypeLink |NSTextCheckingTypePhoneNumber
error:&error];
NSArray *matches = [detectormatchesInString:content
options:0
range:NSMakeRange(0, [contentlength])];
for (NSTextCheckingResult *matchin matches) {
if (([matchresultType] ==NSTextCheckingTypeLink)) {
NSURL *url = [matchURL];
[attributedStringaddAttribute:NSLinkAttributeNamevalue:urlrange:match.range];
}
}
return attributedString;
}
- (void)setInstagramItem:(InstagramItem *)instagramItem {
_instagramItem = instagramItem;
self.likeLabel.text = [NSStringstringWithFormat:@"%@次赞", instagramItem.likeCount];
self.commentLabel.attributedText = [selffilterLinkWithContent:instagramItem.comment];
}