iPh*_*per 1 iphone rotation carousel
我正在使用 Nick Lockwood 旋转木马,类型为轮式旋转木马。我将图像用作轮播中的项目。问题是,当我旋转轮播时,图像也会旋转,即考虑一个人图像,然后人图像会倾斜,这是我不想要的,即我不想在旋转整个轮播时旋转该特定图像。有人可以帮忙吗?
- (CATransform3D)transformForItemView:(UIView *)view withOffset:(CGFloat)offset;查看Find thecase iCarouselTypeWheel:和块的实现case iCarouselTypeInvertedWheel:。
更改生成最终变换的代码(对于垂直和水平情况)以反转所应用的旋转:
transform = CATransform3DTranslate(transform, 0.0f, radius, 0.0f);
transform = CATransform3DRotate(transform, angle * offset, 0.0f, 0.0f, 1.0f);
// this is the transform the existing code returns...
transform = CATransform3DTranslate(transform, 0.0f, -radius, offset * 0.01f);
// instead you reverse the rotation before returning...
return CATransform3DRotate(transform, -(angle * offset), 0.0f, 0.0f, 1.0f);
Run Code Online (Sandbox Code Playgroud)
我希望这有帮助。
| 归档时间: |
|
| 查看次数: |
765 次 |
| 最近记录: |