点击页面,UINavigationController导航栏的隐藏和显示

    技术2022-05-13  8

    在iphone的照片库中,显示照片列表中,导航栏可以自动显示和隐藏。许多应用中也用到了导航栏中的隐藏和显示,实现效果如下图:

    点击页面,导航栏隐藏:

    下面是具体的实现过程。

     

    首先创建工程,iphone.navta.

    然后打开MainWindow.xib

    添加UINavigationController。

     

     

     

    进行关联。

    在具体需要隐藏和显示导航栏的controller中实现:

    #pragma mark – #pragma mark onClick -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {       isflage=!isflage;     [super.navigationController setNavigationBarHidden:isflage animated:TRUE];    [super.navigationController setToolbarHidden:isflage animated:TRUE]; }

    源代码:http://easymorse-iphone.googlecode.com/svn/trunk/iphone.navta/


    最新回复(0)