美文网首页
tableView中cell、collectionView中ce

tableView中cell、collectionView中ce

作者: Amok校长 | 来源:发表于2016-08-18 12:32 被阅读0次

collectionView的cell中重写下面两个方法

- (void)setSelected:(BOOL)selected {

[super setSelected:selected];

if (selected) {

self.imageView.highlighted = NO;

}

}

- (void)setHighlighted:(BOOL)highlighted {

[super setHighlighted:highlighted];

if (highlighted) {

self.imageView.highlighted = YES;

} else {

self.imageView.highlighted = NO;

}

}

tableView的cell中重写下边两个方法

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {

[super setSelected:selected animated:animated];

if (selected) {

self.iconView.highlighted = NO;

}

}

- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated {

[super setHighlighted:highlighted animated:animated];

if (highlighted) {

self.iconView.highlighted = YES;

} else {

self.iconView.highlighted = NO;

}

}

相关文章

网友评论

      本文标题:tableView中cell、collectionView中ce

      本文链接:https://www.haomeiwen.com/subject/xrevsttx.html