//
//  HomeViewController.m
//  ALand
//
//  Created by Z on 16/3/17.
//  Copyright © 2016年 Z. All rights reserved.
//

#import "HomeViewController.h"
#import "HomeTopView.h"
#import "HomeCollectionViewController.h"
@interface HomeViewController ()

@end

@implementation HomeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setUpView];
    // Do any additional setup after loading the view.
}
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [self.navigationController setNavigationBarHidden:YES];
}

- (void)setUpView {
    HomeTopView *viewHomeTop = [HomeTopView viewWithNibName:@"HomeTopView"];
    [self.view addSubview:viewHomeTop];
    viewHomeTop.sd_layout.topEqualToView(self.view).leftEqualToView(self.view).rightEqualToView(self.view).heightIs(150);
    [viewHomeTop updateLayout];
    
    
    HomeCollectionViewController *homeCollectionView = [[HomeCollectionViewController alloc] init];
    [self addChildViewController:homeCollectionView];
    [self.view addSubview:homeCollectionView.view];
    homeCollectionView.view.sd_layout.topSpaceToView(viewHomeTop, 0).leftEqualToView(self.view).rightEqualToView(self.view).bottomEqualToView(self.view);
    [homeCollectionView.view updateLayout];
//    [self.view addSubview:self.collectionView];
//    _collectionView.backgroundColor = [UIColor colorWithWhite:0.949 alpha:1.000];
//    _collectionView.contentSize = CGSizeMake(0, ScreenSize.height - 150);
//    _collectionView.sd_layout.topSpaceToView(viewHomeTop,0).leftEqualToView(self.view).rightEqualToView(self.view).bottomEqualToView(self.view);
//    [_collectionView  updateLayout];
    
    
    
    
   

    
}

- (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
