Ich habe UICollectionView mit UIImageView darauf (wie im Bild gezeigt).UIImageView sollte als Kreisansicht statt Diamant in UICollectionView sein
Und ich will es als Kreis Ansicht machen. Aber wenn ich eine Anwendung starte, erscheint sie als Diamant (Bild unten).
In (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
ich Setup als
[cell.photo setImageWithURL:[NSURL URLWithString:url] usingActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
cell.photo.layer.cornerRadius = cell.photo.bounds.size.width/2;
cell.photo.layer.masksToBounds = NO;
cell.photo.clipsToBounds = YES;
Für Setup-Bild verwendete ich Libs SDWebImage
Und Ich bin sicher, dass corner Wert korrekt (es ist halb so Bild breite). Auch habe ich keine manuellen Änderungen an den Storyboard-Eigenschaften vorgenommen (Position als Auto-Layout). Was habe ich vermisst?
Hinzufügen '(void) layoutSubviews' in benutzerdefinierte UICollectionCell funktioniert wie eine Magie. Vielen Dank. – levo4ka
layoutSubviews wird für mich tun. – jayellos