I'm trying to understand why this is not working
in my tableViewcontroller viewDidLoad
self.headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 5, 320,0)]; self.headerLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 5, 320, 0)]; self.headerLabel.textAlignment = NSTextAlignmentCenter; self.headerLabel.text = @"text"; [self.view addSubview:self.headerView]; [self.headerView addSubview:self.headerLabel]; [UIView animateWithDuration:.5 delay:0.0 options:UIViewAnimationOptionCurveEaseIn animations:^{ self.headerLabel.frame = CGRectMake(0, 5, 320,15); self.headerView.frame = CGRectMake(0, 5, 320,15); } completion:^(BOOL finished) { [UIView animateWithDuration:.5 delay:2.0 options:UIViewAnimationOptionCurveEaseIn animations:^{ self.headerLabel.frame = CGRectMake(0, 5, 320,0); self.headerView.frame = CGRectMake(0, 5, 320,0); } completion:^(BOOL finished) { }]; }];
if I delete the backup portion of the slide in the completion block of the first animation call. It works. View slides down. However, I can’t get it fully compressed. When I include the slide code in the completion block, the view does not appear at all at startup, and I don’t know why and Im going insane
ios objective-c animation slider
Stonep123
source share