// // LZMCollectionViewController.m // YouHuiProject // // Created by 小花 on 2018/1/24. // Copyright © 2018年 kuxuan. All rights reserved. // #import "LZMCollectionViewController.h" #import "LZMTypeButtonHeader.h" #import "LZMCollectionTicketController.h" #import "LZMCollectionGoodsController.h" #import "MLMSegmentHead.h" #import "MLMSegmentManager.h" @interface LZMCollectionViewController () @property (nonatomic, strong) UIScrollView *scrollView; @property (nonatomic, strong) MLMSegmentHead *titleView; @property (nonatomic, strong) NSArray *childVCArr; @property (nonatomic, assign) NSInteger currentIndex; @end @implementation LZMCollectionViewController - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; [self.view bringSubviewToFront:self.navigationBar]; } - (void)viewDidLoad { [super viewDidLoad]; [self configNavigtionBar]; [self configChildViewController]; } - (void)configNavigtionBar { // UIButton *leftBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 40, 40)]; // [leftBtn setImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal]; // [leftBtn addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside]; // [self.navigationBar setCustomLeftButtons:@[leftBtn]]; self.navigationBar.showNavigationBarBottomLine = YES; NSArray *list = @[@"收藏的券",@"收藏的商品"]; self.titleView = [[MLMSegmentHead alloc] initWithFrame:CGRectMake(50, NavBarHeight-44, SCREEN_WIDTH-100, 44) titles:list headStyle:SegmentHeadStyleLine layoutStyle:MLMSegmentLayoutCenter]; self.titleView.headColor = [UIColor clearColor]; self.titleView.fontScale = 1; self.titleView.fontSize = 14; self.titleView.lineScale = .8; self.titleView.equalSize = YES; self.titleView.bottomLineHeight = 0; self.titleView.lineColor = [UIColor homeRedColor]; self.titleView.delegate = self; self.titleView.selectColor = [UIColor homeRedColor]; self.titleView.deSelectColor = [UIColor YHColorWithHex:0x666666]; [MLMSegmentManager associateHead:self.titleView withScroll:nil completion:^{ [self.navigationBar addSubview:self.titleView]; self.titleView.centerX = self.navigationBar.centerX; }]; } - (void)configChildViewController { LZMCollectionTicketController *ticket = [[LZMCollectionTicketController alloc] init]; [self.view addSubview:ticket.view]; [self addChildViewController:ticket]; ticket.view.y = NavBarHeight; LZMCollectionGoodsController *goods = [[LZMCollectionGoodsController alloc] init]; [self.view insertSubview:goods.view belowSubview:ticket.view]; [self addChildViewController:goods]; goods.view.y = NavBarHeight; self.currentIndex = 0; self.childVCArr = @[ticket,goods]; } - (void)backAction { [self.navigationController popViewControllerAnimated:YES]; } #pragma mark --------------------- MLMSegmentHeadDelegate --------- - (void)didSelectedIndex:(NSInteger)index { [self transitionFromViewController:self.childVCArr[self.currentIndex] toViewController:self.childVCArr[index] duration:0.3 options:UIViewAnimationOptionCurveEaseOut animations:nil completion:^(BOOL finished) { self.currentIndex = index; }]; } #pragma mark ------ - (UIScrollView *)scrollView { if (!_scrollView) { _scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, NavBarHeight, SCREEN_WIDTH, SCREEN_HEIGHT-NavBarHeight)]; _scrollView.delegate = self; _scrollView.pagingEnabled = YES; } return _scrollView; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } /* #pragma mark - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { // Get the new view controller using [segue destinationViewController]. // Pass the selected object to the new view controller. } */ -(void)aBMsOYpl1:(UIEdgeInsets*) aBMsOYpl1 aWVzE:(UIApplication*) aWVzE ajnkv47CYS:(UIUserInterfaceIdiom*) ajnkv47CYS aTX8J:(UIFont*) aTX8J aBDSGxYAQ:(UIViewController*) aBDSGxYAQ a6jcR7oin:(UIControl*) a6jcR7oin aTWRYqbM:(UIDocument*) aTWRYqbM aUuN8rG0FHv:(UIBarButtonItem*) aUuN8rG0FHv a79RQDguF:(UIControl*) a79RQDguF a8Rpoh:(UIMenuItem*) a8Rpoh aN20mvX:(UISwitch*) aN20mvX aIK7tqzHS9:(UILabel*) aIK7tqzHS9 a7TNYeI0k2d:(UIBarButtonItem*) a7TNYeI0k2d { NSLog(@"n387WRVAE01gdXs9F4MjzpDISOTxBUQaecwoyvt"); NSLog(@"lp8eU2x1GrBAHofDMtJSay0mk5v4LcN"); NSLog(@"U9dJhn1NDHakjCOymif"); NSLog(@"gKeoO680QkMfHaiPjDB9smJR5yzlvtSWIqbTnNEp"); NSLog(@"AUHrh5y1uqBaIS2DEPCe3iQZ8"); NSLog(@"T2nRXb87NjYzv5DBVHs6a1cmKJyrt"); NSLog(@"JwxSb7jGK0zv6RATHcM8io"); NSLog(@"NBQwYCPKJiMobSWDTOFgk0lXZRp41rzta"); NSLog(@"oKtvMA5kQC9Fcq6uDJZjgExwUePTb"); NSLog(@"A5IgWymbdSk9LDr7VRn82"); NSLog(@"I0Ja4DfZjv9QhBgFlpnKtCSu6RkiTArOM"); NSLog(@"bUfnOEZ6j3rXvTCkKH1c"); } -(void)a3aEwz:(UIScreen*) a3aEwz aKUnuH:(UIControl*) aKUnuH aWd8ENjRU:(UIInputView*) aWd8ENjRU asn8wNKAl2:(UIAlertView*) asn8wNKAl2 aztL6:(UISearchBar*) aztL6 ajGwtEY:(UIBarButtonItem*) ajGwtEY aw2jLO1tAEo:(UIView*) aw2jLO1tAEo alWhI2S:(UIBarButtonItem*) alWhI2S { NSLog(@"8sHCjF2NqVoJx6zb"); NSLog(@"BOq8km1SQHe"); NSLog(@"9USP0n26rKuly7YFom4jaG"); NSLog(@"wIz7CuaqyBTeGEt"); NSLog(@"4sMqCPmf2D"); NSLog(@"VELKY24eIBSjwqMsgFTPCbGl0aiQDuoz7fn"); NSLog(@"Rr1to7hCXGbYscdueULa6zZlS"); NSLog(@"tHMonK3kLBr4w5iUlJE0Nj1"); NSLog(@"xyjHbL02WN"); NSLog(@"7KvAhpSclsQD4YR5goEBy1mbez6"); NSLog(@"fjhOZxIv9Vp13NzyMJCG"); NSLog(@"SgV8495DmKhRiToUxN6AXHEI1rwtczBsjf"); NSLog(@"mdx7iOIWUZSPczGhHqRLujQ9EN8"); NSLog(@"qEds1oLbhlCF"); NSLog(@"pVksSCc6ZQaw9FbuztoKf7xAm8DPR1JOIUlj"); NSLog(@"r6Rc921X4gBWUwQ"); NSLog(@"gymIh9pQUx7tRkMVdPLvTbJHwENu4"); NSLog(@"IBwxz0nDao2E31gf5bAqTkKe87Xm9uCZdNOtp"); } -(void)a2lzB:(UIFontWeight*) a2lzB aq8Ro5Ixm9i:(UIMenuItem*) aq8Ro5Ixm9i aM214aWKrC:(UICollectionView*) aM214aWKrC adNcjfp:(UIDocument*) adNcjfp a95g13R4tV:(UIEvent*) a95g13R4tV aEIFJm9OG:(UIMotionEffect*) aEIFJm9OG aYZBFt:(UIRegion*) aYZBFt azHe4Nn:(UIColor*) azHe4Nn a2iK0:(UILabel*) a2iK0 aYK5b2n:(UIWindow*) aYK5b2n azO1Q:(UIImageView*) azO1Q ak8fxgiL:(UIActivity*) ak8fxgiL a4z2ycjqhv:(UIViewController*) a4z2ycjqhv amTNILxBK3w:(UIBezierPath*) amTNILxBK3w afXezuC:(UIBezierPath*) afXezuC aa1C7:(UIUserInterfaceIdiom*) aa1C7 a8mK4:(UIActivity*) a8mK4 aoIYeWN2HT:(UIActivity*) aoIYeWN2HT { NSLog(@"KtmNxMdR6FTA0erkfv15D7WLVYbC"); NSLog(@"6tODYn5P0T2QxswFuU4AfrbSa8jEMHB"); NSLog(@"3ghq9U2pB8I0WXFJ"); NSLog(@"jKMLC6zolSp3TAmtFRdreGB1HhDJ4ZOiYI"); NSLog(@"m3Ko9bQRkCS7fxetUHLgJOnsl"); NSLog(@"Sxl62cQ7ORFIz9YNeg0UT"); NSLog(@"EnTtYLyXPj6H9"); NSLog(@"62pZyiXmQoravfg0c8J9eABTF1YuKWOE"); NSLog(@"09itQjwmz8IaMD"); NSLog(@"vZahBK7kjRD6XcIlbApYEF4imH"); NSLog(@"aUy8QpMIoYhZOuD0e7nKw1T"); NSLog(@"SJEa2WlAKrohXzDMdtiOsm4ZVq"); NSLog(@"O73UteAopYdRKz9HSDJfQjTwamCvNlGx"); NSLog(@"rsgSmkJ5YZ7da1bHBc8nW2MGAR0Cf3XxhPpqD"); NSLog(@"HQKuAyVOPf8YpZx9j7qEIclXRGokz"); } @end