android菱形imageview,ios – 在UICollectionView中,UIImageView应该是圆形视图而不是菱形...
我有UICollectionView和UI
ImageView(如圖所示).
我想把它作為圓形視圖.但是,當我運行應用程序時,它顯示為菱形(下圖).
在(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView中
cellForItemAtIndexPath:(NSIndexPath *)indexPath {
我把它設置為
[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;
對于設置圖像,我使用了libs SDWebImage
而且我確定,cornerRadius值是正確的(它是圖像寬度的一半).此外,我沒有在故事板屬性中進行任何手動更改(位置設置為自動布局).
我錯過了什么?
總結
以上是生活随笔為你收集整理的android菱形imageview,ios – 在UICollectionView中,UIImageView应该是圆形视图而不是菱形...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 怎么用电脑玩仙国志(手游仙国志怎么样)
- 下一篇: android手机打电话src,【SPI