0

当用户点击“下一步”按钮时,另一个按钮应该会消失,并且“下一步”按钮本身应该在原来的位置,并且应该出现一个 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 {

        }
    }
4

0 回答 0