澎湃iPad上线版本

letterInfoContentCell.m 2.3KB

    // // letterInfoContentCell.m // ThePaperHD // // Created by liyuan on 15/7/17. // Copyright (c) 2015年 scar1900. All rights reserved. // #import "letterInfoContentCell.h" @interface letterInfoContentCell(){ CGFloat contentHieght; } @property(nonatomic, strong)UITextView *content; @end @implementation letterInfoContentCell @synthesize contentStr = _contentStr; - (void)awakeFromNib { // Initialization code } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; // Configure the view for the selected state } -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { self.backgroundColor = [UIColor colorWithHexString:BackGroundColor]; self.selectionStyle = UITableViewCellSelectionStyleNone; [self.contentView addSubview:self.content]; } return self; } -(UITextView *)content{ if (!_content) { _content = [UITextView new]; _content.font = appFont(14, NO); _content.textColor = [UIColor colorWithHexString:TextBlack]; // _content.lineBreakMode = NSLineBreakByWordWrapping; // _content.numberOfLines = 0; //【需求】私信支持复制(bug:5975) [_content setEditable:NO]; _content.scrollEnabled = NO; _content.showsVerticalScrollIndicator = NO; _content.showsHorizontalScrollIndicator = NO; _content.backgroundColor = [UIColor clearColor]; } return _content; } -(void)setContentStr:(NSString *)str{ _contentStr = str; //【需求】私信支持复制(bug:5975) self.content.attributedText = getLineSpaceAttributedString(str, 5, appFont(14, NO)); //【倒退】新闻详情页和私信详情页:夜间模式下新闻详情页的标题和私信内容未做反色(bug:6048) self.content.textColor= [UIColor colorWithHexString:TextBlack]; CGSize contentSize = [self.content sizeThatFits:CGSizeMake(CGRectGetWidth(self.contentView.bounds)-30, 0)]; contentHieght = contentSize.height; [self layoutSubviews]; } -(void)layoutSubviews{ [super layoutSubviews]; self.content.frame = CGRectMake(15, 10, CGRectGetWidth(self.contentView.bounds)-30, CGRectGetHeight(self.contentView.bounds)); } @end