iphone - 如何为 coverflow 中的 UIimage 设置 Action ?

标签 iphone ios xcode uiimage coverflow

这是我的代码,我创建了图像数组,它通过触摸图像引导到另一个页面..我得到了图像的封面流,但无法为图像设置 Action ..任何人都可以帮忙吗?...

[super viewDidLoad];

loadImagesOperationQueue = [[NSOperationQueue alloc] init];
NSString *imageName;

for (int i=0; i<10; i++) {
    imageName = [[NSString alloc] initWithFormat:@"cover_%d.jpg", i];

    [(AFOpenFlowView *)self.view setImage:[UIImage imageNamed:imageName] forIndex:i];
    [imageName release];
    NSLog(@"%d is the index",i);

}
[(AFOpenFlowView *)self.view setNumberOfImages:10];

- (UIImage *)defaultImage{

return [UIImage imageNamed:@"cover_1.jpg"];
}

在这里,我已经按照以下链接教程获取 coverflow.. http://blog.objectgraph.com/index.php/2010/04/09/how-to-add-coverflow-effect-on-your-iphone-app-openflow/

最佳答案

编辑:

如果您需要一种在点击图像时使用react的方法,请查看 this fork I made to AFOpenFlow .您将看到一个新类 SDSOpenFlowView,它派生自 AFOpenFlow,以及一个扩展原始委托(delegate)协议(protocol)的 SDSOpenFlowViewDelegate。它还支持图像的抖动和长压。

旧答案:

为您的封面流 View 设置委托(delegate),例如。如果您在 Controller 内部执行此操作并让您的 Controller 成为委托(delegate):

coverFlowView.delegate = self;

然后定义这个方法

- (void)openFlowView:(AFOpenFlowView *)openFlowView selectionDidChange:(int)index;

在您的 Controller 中:当用户选择不同的页面时将调用它。

关于iphone - 如何为 coverflow 中的 UIimage 设置 Action ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11049941/

相关文章:

iphone - 将日期/时间存储到核心数据中的最佳方法

iphone - 新的现代 Objective-C 枚举类型检查

iphone - 如何在创建 CustomCell 之前计算文本大小

iphone - Xcode iOS 理解堆栈跟踪

ios - 如何在 Swift 中转换为泛型类型

iphone - AVAudioPlayer 错误加载文件

ios - 在Facebook iOS中预填充评论字段

ios - 在 iOS 中未填充所有 UITextField 时尝试禁用按钮

c# - 如何将 UIImageView 添加到 xamarin.forms 中的 UIAlertView?

xcode - @2x 图像不显示在 XCode 界面构建器设计器中