登录 立即注册
金钱:

Code4App-iOS开发-iOS 开源代码库-iOS代码实例搜索-iOS特效示例-iOS代码例子下载-Code4App.com

MMGooglePlayNewsStand

来自: 李世铿 分类: iOS精品源码 上传时间: 2016-4-15 16:05:58

项目介绍:

Google Play 样式的视图布局效果

必须的文件
MMContainerViewController
MMMenuScroll
BaseViewController
UIView+MaterialDesign
UIColor+HexRepresentation
JBKenBurnsView

Objective-C Project Example
[Objective-C] 查看源文件 复制代码
//In view did load init the view controllers
 MMTableViewController *vc_one = [self.storyboard instantiateViewControllerWithIdentifier:@"demo"];
    vc_one.title = @"Highlights";
    vc_one.logoColor = @"4caf50";
    vc_one.logoImage = @"highlights";

    MMTableViewController *vc_two = [self.storyboard instantiateViewControllerWithIdentifier:@"demo"];
    vc_two.title = @"Sports";
    vc_two.logoColor = @"009688";
    vc_two.logoImage = @"sports";

    MMTableViewController *vc_three = [self.storyboard instantiateViewControllerWithIdentifier:@"demo"];
    vc_three.title = @"Entertainment";
    vc_three.logoColor = @"673ab7";
    vc_three.logoImage = @"movie";

    MMTableViewController *vc_four = [self.storyboard instantiateViewControllerWithIdentifier:@"demo"];
    vc_four.title = @"News";
    vc_four.logoColor = @"ff9800";
    vc_four.logoImage = @"world";


    MMCollectionViewController *vc_five = [self.storyboard instantiateViewControllerWithIdentifier:@"collection"];
    vc_five.title = @"Technology";
    vc_five.logoColor = @"9c27b0";
    vc_five.logoImage = @"tech";


     //init the view container controller
    self.containerVC = [[MMContainerViewController alloc] initWithControllers:@[vc_one , vc_two , vc_three , vc_four,vc_five] parentViewController:self];
    vc_one.scrolldeleagte = self.containerVC ;
    vc_two.scrolldeleagte = self.containerVC ;
    vc_three.scrolldeleagte = self.containerVC ;
    vc_four.scrolldeleagte = self.containerVC ;
    vc_five.scrolldeleagte = self.containerVC ;

     //init the colors
    self.containerVC.itemViewColorArray = @[@"4caf50",@"009688",@"673ab7",@"ff9800",@"9c27b0"];

    //init the font
    self.containerVC.menuItemFont = [UIFont fontWithName:@"Roboto-Medium" size:15];
    //init the indicator color
    self.containerVC.menuIndicatorColor = [UIColor whiteColor];

    //init the images used in kensburn
    self.containerVC.images = @[[UIImage imageNamed:@"ironman.jpg"],[UIImage imageNamed:@"worldbg.jpg"],[UIImage imageNamed:@"sportsbg.jpg"],[UIImage imageNamed:@"applebg.png"],[UIImage imageNamed:@"businessbg.jpg"]];

    [self.view addSubview:self.containerVC.view];
  


Swift Project Example
[Actionscript3] 查看源文件 复制代码
let vc_one = self.storyboard?.instantiateViewControllerWithIdentifier("demo") as? MMTableViewController
        vc_one!.title = "Highlights";
        vc_one!.logoColor = "4caf50";
        vc_one!.logoImage = "highlights";

        let vc_two = self.storyboard?.instantiateViewControllerWithIdentifier("demo") as? MMTableViewController
        vc_two!.title = "Sports";
        vc_two!.logoColor = "009688";
        vc_two!.logoImage = "sports";

        let vc_three = self.storyboard?.instantiateViewControllerWithIdentifier("demo") as? MMTableViewController
        vc_three!.title = "Entertainment";
        vc_three!.logoColor = "673ab7";
        vc_three!.logoImage = "movie";

        let vc_four = self.storyboard?.instantiateViewControllerWithIdentifier("demo") as? MMTableViewController
        vc_four!.title = "News";
        vc_four!.logoColor = "ff9800";
        vc_four!.logoImage = "world";

        let vc_five = self.storyboard?.instantiateViewControllerWithIdentifier("collection") as? MMCollectionViewController
        vc_five!.title = "Technology";
        vc_five!.logoColor = "9c27b0";
        vc_five!.logoImage = "tech";

        let containerVC = MMContainerViewController(controllers: [vc_one! , vc_two! , vc_three! , vc_four!,vc_five!], parentViewController: self)
        vc_one!.scrolldeleagte = containerVC ;
        vc_two!.scrolldeleagte = containerVC
        vc_three!.scrolldeleagte = containerVC
        vc_four!.scrolldeleagte = containerVC
        vc_five!.scrolldeleagte = containerVC

        containerVC.itemViewColorArray = ["4caf50","009688","673ab7","ff9800","9c27b0"];
        containerVC.menuItemFont = UIFont(name: "Roboto-Medium", size: 15)
        containerVC.menuIndicatorColor = UIColor.whiteColor()
        containerVC.images = [UIImage(named: "ironman.jpg")!,UIImage(named: "worldbg.jpg")!,UIImage(named: "sportsbg.jpg")!,UIImage(named: "applebg.png")!,UIImage(named: "businessbg.jpg")!]


        view.addSubview(containerVC.view);




相关源码推荐:

我来说两句
*滑动验证:
所有评论(58)
雁过无痕一代 2016-4-16 11:05:39
我只是路过打酱油的。
回复
小耳 2016-4-16 14:35:20
感谢分享,Code4App有你更精彩:)
回复
mingogo 2016-4-16 14:48:18
精华内容,楼主V5!
回复
jockli45678 2016-4-17 22:45:48
我只是路过打酱油的。
回复
carter300 2016-4-17 23:07:14
学习学习!
回复
flkg0213 2016-4-18 09:40:43
楼主威武啊,Code4App有你更给力!
回复
lijunzhou 2016-4-18 10:03:10
虽不明,但觉厉!
回复
nlgs0742 2016-4-18 10:15:19
强烈支持楼主ing……
回复
lxrv0908 2016-4-18 15:55:29
虽不明,但觉厉!
回复
提取码:  下载次数:53 状态:已购或VIP 售价:0(原价:5)金钱 下载权限:初级码农 
1071 0 53
联系我们
首页/微信公众账号投稿

帖子代码编辑/版权问题

QQ:435399051,742864542

如何获得代码达人称号?

代码贡献英雄榜
用户名 下载数
通过邮件订阅最新 Code4App 信息
上一条 /4 下一条
联系我们
关闭
合作电话:
13802416937
Email:
435399051@qq.com
商务市场合作/投稿
问题反馈及帮助
联系我们

广告投放| Github|申请友链|手机版|Code4App ( 粤ICP备15117877号-1 )

快速回复 返回顶部 返回列表