ユーザーが「次へ」ボタンをタップすると、他のボタンが消え、「次へ」ボタン自体が以前と同じ場所に表示され、tableView が表示されます。これは 1.0 秒以内に発生します。問題は、アニメーションの後、UIButton が機能を失ったことです。押せませんが見えます。メインビューのサブビューです。これが私のコードです:
- (IBAction)nextStep:(id)sender {
NSLog(@"Test");
//Check if the other button is in the view
if ([theNewPhotoButton isDescendantOfView:self.view]) {
[UIView animateWithDuration:1.0
animations:^{
theNewPhotoButton.frame = CGRectMake(-1000, theNewPhotoButton.frame.origin.y, theNewPhotoButton.frame.size.width, theNewPhotoButton.frame.size.height);
} completion:^(BOOL finished) {
CGRect screenSize = [[UIScreen mainScreen] bounds];
[self.view addSubview:nextButton];
} else if ([tagView isDescendantOfView:self.view]) {
if (tagProductArray != nil) {
imageView.frame = CGRectMake(10, 30, 100, 100);
tagView.frame = CGRectMake(-1000, tagView.frame.origin.y, tagView.frame.size.width, tagView.frame.size.height);
[self.view addSubview:nextButton];
[tagView removeFromSuperview];
} else {
}
}