//点击返回操作后
-(void)viewWillDisappear:(BOOL)animated{
UIStoryboard *story=[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
ScrollerViewController *mainList=[story instantiateViewControllerWithIdentifier:@"mainNavigation"];
if ([mainList respondsToSelector:@selector(popoverPresentationController)]) {
mainList.popoverPresentationController.sourceView = self.view;
}
[self.parentViewController presentViewController:mainList animated:NO completion:nil];
}
-(void)viewWillAppear:(BOOL)animated{
//设置导航栏宽度
CGRect r = [[UIScreen mainScreen] applicationFrame];
self.navigationItem.titleView.frame=CGRectMake(0, 0, r.size.width, 40);
//设置页面返回时 刷新页面
//获取分类
CommenData *c= [[CommenData alloc]init];
self.category=[c getCategory];
indexPage=0;
secondPage=0;
//导航更新
[self.scrollnavi layoutSubviews] ;
[self.scrollnavi setSelectedIndex:indexPage];
//页面布局
[self layoutSubviews];
//设置按钮
[_setButton addTarget:self action:@selector(goToSet) forControlEvents:UIControlEventTouchUpInside];
}