我想知道我们如何为 pdf 列表实现封面流动效果,双击时,它应该打开相应的 pdf。我真的很震惊,请帮帮我
提前致谢
在 openFlowView.m 文件中搜索这个方法
- (void)awakeFromNib {
[self setUpInitialState];
}
Now when you find this replace this method by below or add lines of tapGestureRecognizer.
- (void)awakeFromNib {
[self setUpInitialState];
UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(screenTapped:)];
[tapRecognizer setNumberOfTapsRequired:2];
[self addGestureRecognizer:tapRecognizer];
[tapRecognizer release];
}
screenTapped is my method that gets called when I tap twice on cover flow.
- (void)screenTapped:(UITapGestureRecognizer *)tap {
NSLog(@"Screen tapped");
//put your points of your coverflow coordinates
if(coverPointimage.x > 0 && coverPointimage.x <= 265 && coverPointimage.y >0 && coverPointimage.y <= 205){
[self imageClicked];//either write code or made seperate method that should gets called when you do double tap.
}
}
希望这段代码能节省你几个小时。快乐的编码。
您应该尝试使用 Tapku 库来获得覆盖流效果。它非常简单且可定制。你可以在这里找到它。