首页 > 移动平台 > 详细

可自定义的边栏菜单ios源码

时间:2014-11-20 13:28:45      阅读:257      评论:0      收藏:0      [点我收藏+]

 

这个源码是可自定义的边栏菜单,源码MDMenuViewController,MDMenuViewController提供使用的边栏菜单。菜单项可自定义,由数组组成。菜单上的文字图片等完全支持自定义,菜单还支持横屏。

效果图:
  • <ignore_js_op>bubuko.com,布布扣 

使用方法:


将整个"MDMenuViewController classes"文件夹加入到自己的项目中: 
构件各个页面,继承Child类: 
@interface AboutViewController : MDMenuChildViewController 
@interface AdvisoryViewController :MDMenuChildViewController 
   ...... 

然后由数组组成菜单: 
NSArray *viewControllers = [NSArray arrayWithObjects:[[ServicesViewController alloc] 
            initWithNibName:@"ServicesViewController" bundle:nil],[[FavouritViewController alloc] 
            initWithNibName:@"FavouritViewController" bundle:nil],[[ContactUsViewController alloc] 
            initWithNibName:@"ContactUsViewController" bundle:nil],[[AboutViewController alloc] 
            initWithNibName:@"AboutViewController" bundle:nil], nil]; 

MDMenuViewController *mainViewC = [[MDMenuViewController alloc] initWithChildViewControllers:viewControllers]; 

每个子界面都又方法定制菜单标题喝图片: 
-(NSString*)titleForChildControllerMDMenuViewController:(MDMenuViewController *)menuController 

    return @"About"; 

-(NSString*)iconForChildControllerMDMenuViewController:(MDMenuViewController *)menuController 

    return @"concept-icon-poster60.png"; 

详细说明:http://ios.662p.com/thread-2254-1-1.html

可自定义的边栏菜单ios源码

原文:http://www.cnblogs.com/liniuzen/p/4110209.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!