OStack程序员社区-中国程序员成长平台

标题: iphone - pdf列表的封面流动效果 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 17:19
标题: iphone - pdf列表的封面流动效果

我想知道我们如何为 pdf 列表实现封面流动效果,双击时,它应该打开相应的 pdf。我真的很纠结,请帮帮我

提前致谢



Best Answer-推荐答案


在 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 actionselector(screenTapped];   
    [tapRecognizer setNumberOfTapsRequired:2];
    [self addGestureRecognizer:tapRecognizer];
    [tapRecognizer release];    

}
screenTapped is my method that gets called when I tap twice on cover flow.

- (void)screenTappedUITapGestureRecognizer *)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.
    }


}

希望此代码可以节省您的几个小时。快乐编码。

关于iphone - pdf列表的封面流动效果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7185711/






欢迎光临 OStack程序员社区-中国程序员成长平台 (https://ostack.cn/) Powered by Discuz! X3.4