I have an application in which you click on UIImageView and the buttons disappear and return. The status bar does the same, except that it just arrives quickly. Is there a way to make it fade according to the settings of the buttons? Here is my .m file where there is code for the buttons and the status bar.
.m
- (void)viewDidLoad { ////Loads UIImageView from URL todaysWallpaper.image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://www.inkdryercreative.com/daily/archive/mondays/images/062-mondays-960x640-A.jpg"]]]; _buttonsVisible = false; [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(imageTapped:)]; [todaysWallpaper addGestureRecognizer:tapGesture]; } - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; [[UIApplication sharedApplication] setStatusBarHidden:YES]; } - (void)imageTapped:(UIGestureRecognizer *)sender { float targetA = 0; if(_buttonsVisible == NO) { targetA =1.0; } else { [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(imageTapped:) object:nil]; [[UIApplication sharedApplication] setStatusBarHidden:YES]; [[UIApplication sharedApplication]setStatusBarStyle:UIStatusBarStyleBlackTranslucent]; [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade]; } [UIView beginAnimations:@"MoveAndStrech" context:nil]; [UIView setAnimationDuration:1]; [UIView setAnimationBeginsFromCurrentState:YES]; homeButton.alpha = targetA; infoButton.alpha = targetA; saveButton.alpha = targetA; tweetButton.alpha = targetA; [UIView commitAnimations]; _buttonsVisible = !_buttonsVisible; if(_buttonsVisible) { [self performSelector:@selector(imageTapped:) withObject:nil afterDelay:100.0]; [[UIApplication sharedApplication] setStatusBarHidden:NO ]; [[UIApplication sharedApplication]setStatusBarStyle:UIStatusBarStyleBlackTranslucent]; } }
Any help or guidance would be greatly appreciated. My client wants this to be done on Tuesdays or to find someone else to do this. I put my life in this application, so if you can help share the knowledge. thanks
source share