About iOS navigation controller hide and show a return key is invalid, navigation bar title animation exception

Source: Internet
Author: User

Recently did the demo bug appeared, I think this bug appeared very classic so post it to everyone to see,

The Bug demo is: Clicking the Back button fails with the following GIF illustration

Why will appear so wonderful bug, the system's return key incredibly ineffective, embarrassing and committed, Leng point for a long time also overwhelmed

The source of the bug: When you never hide the navigation bar to return the gesture, the gesture returns half let go, back to the page without hiding the navigation bar, on push other pages, there will be a return key failure problem

Important steps to a bug: gesture return half and let go

The code for the page-hide navigation bar is as follows

    // Show navigation bar    [Self.navigationcontroller Setnavigationbarhidden:no Animated:no];
    // Hide Navigation bar    [Self.navigationcontroller Setnavigationbarhidden:yes Animated:no];

Personally think that the cause of the bug is that when the gesture returned when the navigation bar page is animated (can be used to try other apps), the page title and button will be gradient

The animated that hides the navigation bar and the code that displays the navigation bar is no, so the return of the gesture conflicts, causing problems with the entire navigation controller page and the return key.

The solution is simple, just set the No to Yes.

    Show navigation bar    [Self.navigationcontroller setnavigationbarhidden:no Animated:yes];
    Hide Navigation bar    [Self.navigationcontroller setnavigationbarhidden:yes Animated:yes];

The perfect solution to the bug, will not come again ~ ~

About iOS navigation controller hide and show a return key is invalid, navigation bar title animation exception

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.