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

来源:互联网 发布:手机平板在线qq软件 编辑:程序博客网 时间:2024/05/18 02:20

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

image

点击页面,导航栏隐藏:

image

下面是具体的实现过程。

 

首先创建工程,iphone.navta.

然后打开MainWindow.xib

添加UINavigationController。

 

 

image 

进行关联。

在具体需要隐藏和显示导航栏的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/

原创粉丝点击