简体   繁体   中英

UIViewController not animating smoothly in navigation controller push

I have a UIViewController called StartViewController which has a textview in it. The text view method is called when a url is clicked.

- (BOOL)textView:(UITextView *)textView shouldInteractWithURL:(NSURL *)URL inRange:(NSRange)characterRange
{
    NSString *str = URL.resourceSpecifier;
    NSInteger length = str.length;

    if (length > 1)
    {
        AViewController *aView = [[SearchViewController alloc] init];

        aView.query = str;

        [self.navigationController pushViewController:aView animated:YES];

        return NO;
    }
}

But when the navigationcontroller gets pushed with a value and animate, it doesn't go smoothly. It goes halfway then it disappers and aView is shown.

Why?

Look for problems with AViewController's view.

During push operation StartViewController would slide out to about 60-70% of the screen, at the same time AViewController will slide in at the top of StartViewController. If AViewController's view has any issues (invalid frame size ?) you won't see the slide in animation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM