我正在构建具有图片查看功能的应用程序。我已经将UIScrollView野兽摔倒在地(希望发布我的scrollview知识RSN),并且现在正在尝试复制iPhone照片应用程序的其他一些视觉效果。具体来说,在查看图像时,我想将控件和酒吧分开。如何从iPhone复制动画照片应用程序
我有一种方法,切换状态栏,导航栏和标签栏的可见性,只留下带有图像的滚动视图。滚动视图是全屏。我有一个计时器,在用户做了一些事情(单击屏幕,查看下一个图像等等)3秒后触发,并在timerFired方法中,我打电话给我的方法关闭酒吧。屏幕上点击一下即可打开酒吧。这里是切换全屏状态的方法。
- (void)setFullScreen:(BOOL)fullScreen {
// reset the timer
[myTimer invalidate];
[myTimer release];
myTimer = nil;
// start animation section
[UIView beginAnimations:nil context:nil];
// toggle the status bar
[[UIApplication sharedApplication] setStatusBarHidden:fullScreen animated:YES];
[UIView setAnimationDuration:UINavigationControllerHideShowBarDuration];
CGFloat alpha = fullScreen ? 0.0 : 1.0;
// change the alpha to either 0 or 1 based on hiding or showing the bars
self.navigationController.navigationBar.alpha = alpha;
self.tabBarController.tabBar.alpha = alpha;
// do the animations!
[UIView commitAnimations];
// restart the timer after we show the bars
if (!fullScreen) {
myTimer = [[NSTimer timerWithTimeInterval:3.0 target:self selector:@selector(timerFired:) userInfo:nil repeats:NO] retain];
[[NSRunLoop currentRunLoop] addTimer:myTimer forMode:NSDefaultRunLoopMode];
}
}
这基本上工作,但它看起来不如照片应用程序。我将alpha值设置为动画,因为我相信这看起来更像是照片应用程序,而不是使用可用的隐藏动画方法。我的问题是为状态栏做同样的事情。
我的问题: (1)有没有UIView的状态栏? (2)有没有办法改变状态栏的alpha属性? (3)是另一个UIWindow中的状态栏? (4)有没有另一种方法来实现这个使用“合法”的方法(我需要把这个应用程序在应用程序商店)?
我已经倾倒了UIApplication的windows属性,只有一个窗口,我爬过了视图层次结构,并且没有明显的状态栏视图。
有什么想法?
我无法帮助您使用动画代码,但我一定会希望看到您的UIScrollView代码。 – 2010-01-18 17:06:30
当您有机会时,请分享您的滚动视图代码。我们中的许多人一直在努力模仿iphone照片应用程序,但收效甚微。 – Jonah 2010-06-18 01:40:44