gpt4 book ai didi

ios - 如何在 iOS 7 和 iOS 6 的动画启动画面期间隐藏状态栏?

转载 作者:塔克拉玛干 更新时间:2023-11-02 10:06:10 25 4
gpt4 key购买 nike

我在“didFinishLaunchingWithOptions”方法中创建动画启动画面。动画启动画面持续时间为 2 秒。两秒钟后,我隐藏了动画启动画面。当动画屏幕出现时,我想隐藏状态栏,当动画屏幕消失时,我想显示状态栏。

该怎么做?

  • (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{

//这里我正在创建动画启动画面

***** 这里我想隐藏状态栏* ******

splashView =[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 320, 580)];
splashView.backgroundColor =[UIColor whiteColor];
[self.window addSubview:splashView];


logoView = [[UIImageView alloc] initWithFrame:CGRectMake(logoX,0, 225, 25)];
logoView.image = [UIImage imageNamed:@"logoImage"];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:2.0];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:window cache:YES];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(startupAnimationDone:finished:context:)];
splashView.alpha = 1.0;
logoView.frame = CGRectMake(logoX, logoY, 225, 25);

[window addSubview:logoView];
[window bringSubviewToFront:logoView];

[UIView commitAnimations];

//2 秒后隐藏动画启动画面

- (void)startupAnimationDone:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context {
************* Here i want to show Status bar Again ***************
[splashView removeFromSuperview];
[logoView removeFromSuperview];
}

最佳答案

您进入 ProjectSettings -> General。有一个选项 Status Bar Style

enter image description here

编辑使用 block 。它们为动画提供了非常简单的语法。

  [UIView animateWithDuration:2.0 delay:0 options:UIViewAnimationOptionCurveEaseIn animations:^{
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade];

//your animation code here
//all changes made here to frame, bounds, alpha etc. are animated

} completion:^(BOOL finished) {
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationFade];

//this is called after animation finishes

}];

关于ios - 如何在 iOS 7 和 iOS 6 的动画启动画面期间隐藏状态栏?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22268689/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com