导演:滨口龙介
主演:平野铃 佐藤亮 伊藤绫子 田山幹雄 手塚加奈子
关键词:剧情
"
"
}
};
[dataArray addObject:dataDict1];
NSDictionary *dataDict2 = @{ @"imageUrl":@"hla.jpg",
@"title":@"《海边的卡夫卡》 ",
@"content":@"值得一提的是,本片在2016年戛纳电影节上获得最佳编剧奖,编剧金英焕是韩国著名导演奉俊昊的《寄生虫》编剧。
影片讲述了一名女子来到海边小镇,受到当地居民的冷漠,不得不与一位叫“卡夫卡”的男子同住一个养鱼小屋。两个素不相识的陌生人从相互排斥到理解接纳,最终似乎有把握站起来的故事。这是一个聚集了朴素的感动,悲哀,喜剧,爱情的故事。"
};
[dataArray addObject:dataDict2];
self.cardDataArray = dataArray;
[self addCards];
}
- (void)addCards {
for (int i = 0; i < self.cardDataArray.count; i ) {
HLA_CardView *cardView = [self dequeueReusableCardView];
NSDictionary *cardDataDict = [self.cardDataArray objectAtIndex:i];
// 图片
NSString *imageName = [cardDataDict objectForKey:@"imageUrl"];
cardView.cardImageView.image = [UIImage imageNamed:imageName];
// 标题
NSString *title = [cardDataDict objectForKey:@"title"];
cardView.titleLabel.text = title;
// 内容
NSString *content = [cardDataDict objectForKey:@"content"];
NSMutableAttributedString *contentAttributedString = [[HTMAttributedString sharedInstance] attributedStringFromHTML:content];
cardView.contentLabel.attributedText = contentAttributedString;
// 菜单
NSArray *menu = @[
[[HTMarkdownButton alloc] initWithTitle:@"25" image:nil handler:^(HTMarkdownButton *markdownButton) {
NSLog(@"点赞");
}],
[[HTMarkdownButton alloc] initWithTitle:@"10" image:nil handler:^(HTMarkdownButton *markdownButton) {
NSLog(@"分享");
}],
[[HTMarkdownButton alloc] initWithTitle:@"100" image:nil handler:^(HTMarkdownButton *markdownButton) {
NSLog(@"收藏");
}],
[[HTMarkdownButton alloc] initWithTitle:@"12" image:nil handler:^(HTMarkdownButton *markdownButton) {
NSLog(@"评论");
}]];
cardView.cardMenuView.menu = menu;
[self.cardViews addObject:cardView];
}
// 添加到contentView上,并刷新约束
[self.cardViews makeObjectsPerformSelector:@selector(removeFromSuperview)];
[self.contentView addSubview:self.cardViews[0]];
[self.cardViews[0] makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.contentView);
}];
[self setNeedsUpdateConstraints];
[self updateConstraintsIfNeeded];
}
- (HLA_CardView *)dequeueReusableCardView {
for (HLA_CardView *cardView in self.cardViews) {
if (!cardView.superview) {
return cardView;
}
}
HLA_CardView *cardView = [[HLA_CardView alloc] init];
cardView.delegate = self;
return cardView;
}
- (void)pushToViewController:(UIViewController *)viewController {
[self.viewController.navigationController pushViewController:viewController
animated:YES];
}
#pragma mark - getter and setter
- (NSMutableArray *)cardViews {
if (!_cardViews) {
_cardViews = [NSMutableArray array];
}
return _cardViews;
}
@end
详情
更多影视:
影林影视