模拟iPhone桌面home view,实现spring board功能

源文件支持交流修改使用

开发语言:

分类:其他系统

    分享到:

源码搜索

  • 详情介绍 - 【模拟iPhone桌面home view,实现spring board功能】
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    self.view.backgroundColor = [UIColor whiteColor];
     
    NSMutableArray *folderData = [NSMutableArray arrayWithArray:@[[UIColor orangeColor], [UIColor grayColor]]];
     
    NSArray *originData = @[[UIColor redColor],
                            [UIColor yellowColor],
                            [UIColor blueColor],
                            folderData,
                            [UIColor blackColor]
                           ];
    self.allBoards = [NSMutableArray arrayWithArray:originData];
     
    _collectionViewFlowLayout = [[TBCollectionViewFlowLayout alloc] init];
    _collectionViewFlowLayout.sectionInset = UIEdgeInsetsMake(20, 20, 20, 20);
    _collectionViewFlowLayout.minimumLineSpacing = 20;
    _collectionViewFlowLayout.itemSize = CGSizeMake(60, 80);
     
    _springBoardView = [[TBSpringBoardView alloc] initWithFrame:self.view.bounds collectionViewLayout:_collectionViewFlowLayout];
    _springBoardView.contentInset           = UIEdgeInsetsMake(0, 0, 0, 0);
    _springBoardView.delegate               = self;
    _springBoardView.dataSource             = self;
    _springBoardView.scrollEnabled          = NO;
    _springBoardView.backgroundColor        = [UIColor purpleColor];
    _springBoardView.userInteractionEnabled = YES;
    [self.view addSubview:_springBoardView];
     
    [_springBoardView registerClass:[TBCollectionViewCell class] forCellWithReuseIdentifier:DequeueReusableCell];
 
    [_springBoardView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.view);
    }];
     
    _popupFolderView = [[TBPopupFolderView alloc] init];
    _popupFolderView.backgroundColor = [UIColor whiteColor];
    _popupFolderView.userInteractionEnabled = YES;
    _popupFolderView.collectionView.delegate = self;
    _popupFolderView.collectionView.dataSource = self;
    [_springBoardView addSubview:_popupFolderView];
    [_springBoardView bringSubviewToFront:_popupFolderView];
    _popupFolderView.hidden = YES;
    [_popupFolderView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.view);
    }];
     
    _collectionViewFlowLayout.desktopView = _springBoardView;
    _collectionViewFlowLayout.folderView  = _popupFolderView.collectionView;
}

特别说明:
☉如果服务器暂不能下载请稍后重试!总是不能下载,请联系客服QQ:597260440,谢谢合作!
☉本站所有源码仅供学习与参考,请勿用于商业用途。
模板说明:
源码-模拟iPhone桌面home view,实现spring board功能,其版权归原作者所有,如损害你的权益请联系客服QQ:597260440给予处理。

本文永久链接:http://code.fangbianle.com/goods/show-5206.html

相关源码

在线客服
热线电话

备案号:豫ICP备14017793号-2编辑热线:0371-56691758

Copyight@2014-2018 All Rights Reserved 页面加载耗时0.444秒