// // LDCommunityViewController.m // YouHuiProject // // Created by 小花 on 2018/5/16. // Copyright © 2018年 kuxuan. All rights reserved. // #import "LDCommunityViewController.h" #import "LDCommunityLeftController.h" #import "LDCommunityRightController.h" #import "MLMSegmentHead.h" #import "MLMSegmentManager.h" @interface LDCommunityViewController () { NSInteger _page; } @property (nonatomic, strong) MLMSegmentHead *titleView; @property (nonatomic, strong) MLMSegmentScroll *segScroll; @end @implementation LDCommunityViewController - (void)viewDidLoad { [super viewDidLoad]; [self configNavigationBar]; [self creatSwitchView]; [self addReloadObser]; } - (void)addReloadObser { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshData) name:ChangeSex object:nil]; } - (void)refreshData { [self creatSwitchView]; } - (void)configNavigationBar{ [self.navigationBar setNavTitle:@"今日爆款"]; self.view.backgroundColor = [UIColor whiteColor]; self.navigationBar.navTitleLabel.textColor = [UIColor whiteColor]; self.navigationBar.backgroundColor = [UIColor changeColor]; } -(void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; [SVProgressHUD dismiss]; } -(void)viewDidDisappear:(BOOL)animated{ [super viewDidDisappear:animated]; [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault]; } -(void)viewDidAppear:(BOOL)animated{ [super viewDidAppear:animated]; [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; } - (void)creatSwitchView { self.view.backgroundColor = [UIColor backgroudColor]; NSMutableArray *list = [NSMutableArray array]; // LDCommunityRightController *seg1 = [[LDCommunityRightController alloc] init]; // [list addObject:seg1]; LDCommunityLeftController *seg2 = [[LDCommunityLeftController alloc] init]; [list addObject:seg2]; self.segScroll = [[MLMSegmentScroll alloc] initWithFrame:CGRectMake(0, NavBarHeight, SCREEN_WIDTH, ChildTableViewHeight+40) vcOrViews:list]; self.segScroll.loadAll = YES; [MLMSegmentManager associateHead:nil withScroll:self.segScroll completion:^{ [self.view addSubview:self.segScroll]; }]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } @end