首页 > 移动平台 > 详细

取消ios7下自带的手势滑动导航

时间:2014-04-01 13:19:29      阅读:585      评论:0      收藏:0      [点我收藏+]

在ios7中苹果加入了手势滑动导航,但以前做的项目和这块有一点冲突,所以想去掉苹果自带的手势滑动导航。

取消很简单,只需要自己重写左导航键就可以取消掉系统自带的手势滑动导航。

//设置左边的返回

- (void)setLeftNavigationBar

{

    UIButton *backButton = [UIButton buttonWithType:UIButtonTypeCustom];

    backButton.frame = CGRectMake(0, 0, 170, 26);

    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(40, 0, 130, 26)];

    [label setFont:[UIFont boldSystemFontOfSize:20]];

    [label setTextColor:[UIColor whiteColor]];

    [label setText:@"返回"];

    [label setBackgroundColor:[UIColor clearColor]];

    [backButton addSubview:label];

    [backButton addTarget:self action:@selector(popChatViewController) forControlEvents:UIControlEventTouchUpInside];

    UIBarButtonItem *leftBarButtons = [[UIBarButtonItem alloc] initWithCustomView:backButton];

    self.navigationItem.leftBarButtonItem = leftBarButtons;

}


//返回到上一个界面

- (void)popChatViewController

{

    [self.navigationController popViewControllerAnimated:YES];

}


取消ios7下自带的手势滑动导航,布布扣,bubuko.com

取消ios7下自带的手势滑动导航

原文:http://blog.csdn.net/rbyyyblog/article/details/22721091

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!