简体   繁体   English

使用UITableView进行iPhone视差滚动

[英]iPhone parallax scrolling with UITableView

I am creating a navigation based application, and throughout my application, I want to maintain an image as background. 我正在创建一个基于导航的应用程序,在我的应用程序中,我想将图像保持为背景。 Also, I want parallax scrolling for the background, ie, when I scroll table view cells vertically, background image should scroll at a relatively slower speed. 此外,我想要为背景进行视差滚动,即,当我垂直滚动表格视图单元格时,背景图像应以相对较慢的速度滚动。 Also, my application has some images and text in detail views, which should scroll at higher speed and background at a lower speed. 此外,我的应用程序在详细视图中有一些图像和文本,它们应该以更高的速度滚动并以更低的速度滚动背景。 This I want is to create a 3D effect. 我想要的是创建一个3D效果。 I have gone through cocos2D framework, but its all apps shows a single view and two images, one for foreground and one for background. 我已经通过了cocos2D框架,但它的所有应用程序都显示了一个视图和两个图像,一个用于前景,一个用于背景。 So I need some starting point, whether I am in right direction or not. 所以我需要一些起点,无论我是否朝着正确的方向前进。 Also, is it possible without using cocos2D? 另外,是否可以不使用cocos2D? Please help me for this. 请帮帮我。

Thanks in advance. 提前致谢。

Try to use the - (void)scrollViewDidScroll:(UIScrollView *)scrollView of UIScrollViewDelegate . 尝试使用- (void)scrollViewDidScroll:(UIScrollView *)scrollViewUIScrollViewDelegate
The table view is a sub-class of UIScrollView. 表视图是UIScrollView的子类。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM