【问题标题】:ImageView rotation is not working properly inside the collectionView cellImageView 旋转在 collectionView 单元格内无法正常工作
【发布时间】:2017-10-11 07:26:54
【问题描述】:

ImageView 旋转在collectionView 单元格内无法正常工作,但在collectionView 之外它运行良好。它被拉伸且非常薄,就像它在collectionView 内工作一样

这是我得到的代码和屏幕.. 对于集合视图内的图像视图

imgView.transform=CGAffineTransformMakeRotation([dict[@"SomeValue"]longValue]*M_PI/180);

单元格 0 单元格 1 单元格 2

在集合视图之外。

imageView.transform=CGAffineTransformMakeRotation([dict[@"SomeValue"]longValue]*M_PI/180);

我不知道为什么它在集合中无法正常工作查看帮助我

【问题讨论】:

  • 如何将图像视图添加到单元格中?可能是自动布局挤压图像。另外,image view 的 contentMode 是什么,如果设置为 center 可能会解决问题?
  • UIImageView *imgView=(UIImageView *)[cell viewWithTag:55];内容模式是按比例填充

标签: ios objective-c uiimageview image-rotation


【解决方案1】:

检查您的图片尺寸。

改变内容模式

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-10-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-21
    • 2013-03-13
    相关资源
    最近更新 更多