123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- //
- // KBCollectionMainViewController.m
- // YouHuiProject
- //
- // Created by 小花 on 2018/5/7.
- // Copyright © 2018年 kuxuan. All rights reserved.
- //
- #import "KBCollectionMainViewController.h"
- #import "KBMyCollectionViewController.h"
- #import "JDragonTypeButtonView.h"
- #import "MLMSegmentHead.h"
- #import "MLMSegmentManager.h"
- #import "KBHistoryViewController.h"
- @interface KBCollectionMainViewController ()<MLMSegmentHeadDelegate,MLMSegmentScrollDelegate>
- {
- NSInteger _page;
- }
- @property (nonatomic, strong) MLMSegmentHead *titleView;
- @property (nonatomic, strong) MLMSegmentScroll *segScroll;
- @end
- @implementation KBCollectionMainViewController
- - (void)viewWillDisappear:(BOOL)animated {
- [super viewWillDisappear:animated];
- [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault];
- }
- - (void)viewDidAppear:(BOOL)animated {
- [super viewDidAppear:animated];
- [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
- }
- - (void)viewWillAppear:(BOOL)animated {
- [super viewWillAppear:animated];
- [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
- }
- - (void)viewDidLoad {
- [super viewDidLoad];
-
- [self configNavigationBar];
- [self creatSwitchView];
- }
- - (void)creatSwitchView {
- self.view.backgroundColor = [UIColor whiteColor];
-
- NSArray *titleArr = @[@"我的收藏",@"浏览记录"];
- NSMutableArray *list = [NSMutableArray array];
- for (int i = 0; i < 1; i++) {
- KBMyCollectionViewController *seg = [[KBMyCollectionViewController alloc] init];
- seg.selectedIndex = i;
- [list addObject:seg];
- }
-
- KBHistoryViewController *history = [[KBHistoryViewController alloc] init];
- [list addObject:history];
-
- self.segScroll = [[MLMSegmentScroll alloc] initWithFrame:CGRectMake(0, NavBarHeight+40, SCREEN_WIDTH, SCREEN_HEIGHT-NavBarHeight-40) vcOrViews:list];
- self.segScroll.loadAll = YES;
- self.titleView = [[MLMSegmentHead alloc] initWithFrame:CGRectMake(0, NavBarHeight, SCREEN_WIDTH, 40) titles:titleArr headStyle:SegmentHeadStyleDefault layoutStyle:MLMSegmentLayoutDefault];
- self.titleView.headColor = [UIColor clearColor];
- self.titleView.bottomLineHeight = 1;
- self.titleView.bottomLineColor = [UIColor yhGrayColor];
- self.titleView.fontScale = 1;
- self.titleView.fontSize = 14;
- self.titleView.equalSize = YES;
- self.titleView.showIndex = 0;
- self.titleView.selectColor = [UIColor YHColorWithHex:0xff442a];
- self.titleView.deSelectColor = [UIColor YHColorWithHex:0x666666];
- [MLMSegmentManager associateHead:self.titleView withScroll:self.segScroll completion:^{
- [self.view addSubview:self.titleView];
- [self.view addSubview:self.segScroll];
- }];
-
-
-
- }
- - (void)configNavigationBar {
- _page = 1;
- [self.navigationBar setNavTitle:@"我的收藏"];
- self.navigationBar.backgroundColor = [UIColor changeColor];
- self.navigationBar.navTitleLabel.textColor = [UIColor whiteColor];
- UIButton *leftBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
- [leftBtn setImage:[UIImage imageNamed:@"back_white"] forState:UIControlStateNormal];
- [leftBtn addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside];
- [self.navigationBar setCustomLeftButtons:@[leftBtn]];
- }
- - (void)backAction {
- [self.navigationController popViewControllerAnimated:YES];
- }
- - (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.
- }
- */
- @end
|