当前位置: 首页 动漫 式守同学不只可爱而已
手机观看

式守同学不只可爱而已 (2022)

2022/日本/ 爱情 动画

全剧完结 | 共12集

剧情简介

" ]; UIColor *color = [UIColor colorWithRed:0.902f green:0.886f blue:0.863f alpha:1.0f]; self.tableView.backgroundColor = color; self.tableView.separatorColor = [UIColor clearColor]; self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;}- (void)viewDidLoad { [super viewDidLoad]; [self.tableView registerClass:[NewsTitleCell class] forCellReuseIdentifier:@"cell"]; [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cellOther"];}#pragma mark - Table view data source- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return _titleArr.count * 2;}- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { if (indexPath.row % 2 == 0) { NewsTitleCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath]; cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.titleLabel.text = _titleArr[indexPath.row/2]; cell.summaryLabel.text = _summaryArr[indexPath.row/2]; return cell; } else { UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cellOther" forIndexPath:indexPath]; cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.textLabel.numberOfLines = 0; cell.textLabel.lineBreakMode = NSLineBreakByCharWrapping; cell.textLabel.text = _summaryArr[indexPath.row/2]; return cell; }}- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { if (indexPath.row % 2 != 0) { return 40 [self calculateSizeWithString:_summaryArr[indexPath.row/2] font:[UIFont systemFontOfSize:14] maxW:kWindowW - 30].height; } else { return 80.0f; }}- (CGSize)calculateSizeWithString:(NSString *)string font:(UIFont *)font maxW:(CGFloat)maxW{ CGSize maxSize = CGSizeMake(maxW, MAXFLOAT); // 计算文字 CGRect rect = [string boundingRectWithSize:maxSize options:nil attributes:nil context:nil]; NSDictionary *dict = @{NSFontAttributeName : font}; CGRect rect = [string boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:dict context:nil]; CGSize size = rect.size; return size; }@end

本站所有视频和图片均来自互联网收集而来,本网站只提供web页面服务,并不提供资源存储,也不参与录制、上传
若本站收录的节目无意侵犯了贵司版权,请发邮件至123456@test.cn (我们会在3个工作日内删除侵权内容,谢谢。)

Copyright © 2019 火豆电影网 icp123