0

我正在开发一个 iphone 应用程序。

我正在使用 iCarousel 类: https ://github.com/nicklockwood/iCarousel

我希望这样当有人点击其中一个轮播图像时,图像会翻转以显示图像背面的按钮,人们可以点击这些按钮。

我正在按照本教程来实现 icarousel 类:http: //mobile.tutsplus.com/tutorials/iphone/create-an-awesome-carousel-version-2-0/

如何添加方法来实现我上面描述的目标?

我做了以下事情:

- (void)carousel:(iCarousel *)carousel didSelectItemAtIndex:(NSInteger)index
{

    CGRect frame = CGRectMake(round((self.view.bounds.size.width - 300) / 2.0), 0, 300, 300);

    UIImageView *flipToView = [[UIImageView alloc] initWithFrame: frame];
    flipToView.image = [UIImage imageNamed:@"cl2.png"];

    UIView *containerView = self.aCarousel.currentItemView.superview;

    [UIView transitionFromView: containerView toView: flipToView duration:2.0 options:UIViewAnimationOptionTransitionFlipFromLeft
                    completion:nil];

}

但是我如何为轮播中的每个图像提供不同的翻转图像?就像在轮播上单击的每个图像的翻转视图都是不同的。还有当人们向右滚动时如何隐藏翻转的图像?

4

1 回答 1

0

You can add an extra imageview at the center position of the iCarousel as a sibling view via XIB. Initially the alpha of the view is 0 and becomes 1 only when user select any index and then set the image of the imageview according to selected index and just flip it. And once you have done again set alpha 0. Try this and if you still face any problem let me know because I have already done this type of thing, not same as flipping but I have implemented the scaling on the iCarousel.

于 2012-11-26T11:06:46.827 回答