私は UICollectionView を持っており、このコード (UICollectionViewCell のサブクラス) を使用して、セルが選択されたときに境界線を追加しています。
- (void)isSelected{
NSLog(@"selected");
[self.layer setBorderColor:[UIColor colorWithRed:213.0/255.0f green:210.0/255.0f blue:199.0/255.0f alpha:1.0f].CGColor];
[self.layer setBorderWidth:1.0f];
[self.layer setCornerRadius:9.5f];
}
- (void)isNotSelected{
NSLog(@"not selected");
[self.layer setBorderColor:[UIColor clearColor].CGColor];
[self setNeedsDisplay];
}
セルが選択されている場合は機能しますが、選択を解除すると id は機能しません。両方の呼び出しのログを確認できます。
この境界線を削除するにはどうすればよいですか?
前もって感謝します