tableView中cell、collectionView中ce

2016-08-18  本文已影响0人  Amok校长

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;

}

}

上一篇 下一篇

猜你喜欢

热点阅读