// // SceneLibraryViewController.m // Lighting // // Created by 曹云霄 on 16/5/4. // Copyright © 2016年 上海勾芒科技有限公司. All rights reserved. // #import "SceneLibraryViewController.h" #import "SeceneLibraryCollectionViewCell.h" @interface SceneLibraryViewController () @end @implementation SceneLibraryViewController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. [self uiConfigAction]; } #pragma mark -UI - (void)uiConfigAction { self.seceneLibraryCollectionLayout.itemSize = CGSizeMake((ScreenWidth-6)/3, (ScreenWidth-6)/3-50); self.seceneLibraryCollectionLayout.minimumLineSpacing = 2; self.seceneLibraryCollectionLayout.minimumInteritemSpacing = 2; self.seceneLibraryCollectionLayout.sectionInset = UIEdgeInsetsMake(5, 0, 5, 0); self.seceneLibararyCollectionView.dataSource = self; self.seceneLibararyCollectionView.delegate = self; } - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { SeceneLibraryCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"secenelibrary" forIndexPath:indexPath]; return cell; } - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { return 20; } #pragma mark -切换显示风格 - (IBAction)SwitchdisplayStyleClick:(UIButton *)sender { self.seceneLibraryCollectionLayout.itemSize = CGSizeMake((ScreenWidth-10)/6, (ScreenWidth-10)/6-50); [self.seceneLibararyCollectionView reloadData]; } - (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