MDMenuViewController
------------------------------------------------------------------------------------------
MDMenuViewController is an iOS container view controller that coordinates between its content view controllers through a side menu that is shown from the side with appealing animation , supports iOS 6.0 , 7.0 , 8.0 ,iPhone ,And iPad , Customisable in almost every aspect ,provided with documentation ,And a demo app to get you going right away.
should be compiled with ARC.
-----------------------------------------------------------------------------------------
installation
- just drag the "MDMenuViewController classes" folder to your project
------------------------------------------------------------------------------------------
Basic How to
- prepare an NSArray of the content view Controllers
```objc
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];
```
- each content view controller maintained by MDMenuViewController must conform to the protocol MDMenuViewControllerDelegate And implementing two required methods
```objc
-(NSString*)titleForChildControllerMDMenuViewController:(MDMenuViewController*)menuController
```
which returns the title of the content view controller to be shown on the top bar and in the side menu
```objc
-(NSString*)iconForChildControllerMDMenuViewController:(MDMenuViewController*)menuController
```
which returns the image name in the bundle you want to show for the content view controller beside its title in side
menu , if you wish not to add an icon just return an empty string. and also declare a property
```objc
@property(nonatomic,weak)MDMenuViewController *MenuController
```
alternatively make the content view controllers inherit from MDMenuChildViewController ,and override the
MDMenuViewControllerDelegate methods
- instantiate MDMenuViewController with the initialisation method
- (id)initWithChildViewControllers:(NSArray*)viewControllers and pass it the NSArray of the content view Controllers
- show the MDMenuViewController instance.
- each content view controller can push other view controllers and pop them again like a UINaviagationController each content view controller is a top view controller in a stack of its own so you can push on its stack other view
controllers.
```objc
[self.MenuController pushViewController:anotherViewController animated:YES];
```
you can also control the push transition animation , continue to see how .
- you can add a custom top bar left button by implemeting the MDMenuViewControllerDelegate Method
```objc
-(UIButton*)leftBarButtonForChildControllerMDMenuViewController:
(MDMenuViewController*)menuController;
```
and return a cutom UIButton to replace the left top bar button when this content view controller is shown
---------------------------------------------------------------------------------------------------------------
Customisation
Customise the menu Button
- you can change the icon of the menu button like the following
```objc
[mdMenuControllerInstance.topBar.menuBtn setImage:[UIImage imageNamed:@"side_menu.png"] forState:UIControlStateNormal];
[mdMenuControllerInstance.topBar.menuBtn setImage:[UIImage imageNamed:@"side_menu_active.png"]
forState:UIControlStateHighlighted];
```
Customise the Back Button
- you can change the icon of the back button like the following
```objc
[mdMenuControllerInstance.topBar.backBtn setImage:[UIImage imageNamed:@"side_menu.png"]
forState:UIControlStateNormal];
[mdMenuControllerInstance.topBar.backBtn setImage:[UIImage imageNamed:@"side_menu_active.png"]
forState:UIControlStateHighlighted];
```
Customise the top bar
```objc
//****************************** MDMenuViewController customise top bar
// set main menu button image
[mdMenuViewControllerInstance.topBar.menuBtn setImage:[UIImage imageNamed:@"menu_icon.png"]
forState:UIControlStateNormal];
// set back button image
[mdMenuViewControllerInstance.topBar.backBtn setImage:[UIImage imageNamed:@"backBtn.png"]
forState:UIControlStateNormal];
// set top bar background color
[mdMenuViewControllerInstance.topBar setBackgroundColor:[UIColor colorWithWhite:0.85 alpha:1.0]];
// set top bar title text color
[mdMenuViewControllerInstance.topBar.titleLbl setTextColor:[UIColor whiteColor]];
// set top bar background image
mdMenuViewControllerInstance.topBar.backgroundImage.image = [UIImage imageNamed:@"topBar.jpg"];
//*************************************************************************************************
```
Customise the side Menu
```objc
//****************************** MDMenuViewController customise menu view
// menu item title text color when selected
[mdMenuViewControllerInstance.menuView setMenuItemTitleTextColor:[UIColor whiteColor]
forState:UIControlStateHighlighted];
// menu item title text color when unSelected
[mdMenuViewControllerInstance.menuView setMenuItemTitleTextColor:[UIColor whiteColor]
forState:UIControlStateNormal];
// menu item background color when unSelected
[mdMenuViewControllerInstance.menuView setMenuItemBackgroundColor:[UIColor colorWithRed:(46.0f/
255.0f) green:(46.0f/255.0f) blue:(46.0f/255.0f) alpha:1.0] forState:UIControlStateNormal];
// menu item background color when selected
[mdMenuViewControllerInstance.menuView setMenuItemBackgroundColor:[UIColor colorWithRed:(47.0f/
255.0f) green:(123.0f/255.0f) blue:(154.0f/255.0f) alpha:1.0] forState:UIControlStateHighlighted];
// menu vie background color
[mdMenuViewControllerInstance.menuView setBackgroundColor:[UIColor colorWithRed:(46.0f/255.0f)
green:(46.0f/255.0f) blue:(46.0f/255.0f) alpha:1.0]];
//disabel ripple animation
[mdMenuViewControllerInstance.menuView setDisableRippleAnimation:NO];
//*************************************************************************************************
```
- if you want full control over the content of the side menu view and how its shown , you can create your own menu view provided that it inherits from the base MenuView class and override its interface methods - the base MenuView class is not meant to be used on its own , its just meant to be sub classed - then set your own custom MenuView to the menuView property of your MDMenuViewController instance.
```objc
mdMenuControllerInstance.menuView = yourCustomMenuView;
```
Customise transition Animations
- MDMenuViewController has default animations for push and pop actions , you can make your own animations by declaring your own class that conform to the protocol MDTransitionAnimatorProtocol with only one required method
```objc
-(void)transitionInView:(UIView*)containerView fromView:(UIView*)fromView toView:(UIView*)toView Then to use your
```
custom animator call this method when pushing viewControllers
```objc
[self.MenuController pushViewController:anotherController
withTransitionAnimator:yourCustomAnimator];
```
In order to control pop animation just implement the MDMenuViewControllerDelegate method in your content View Controller
```objc
-(void)topbarViewDidTapBackButton;
```
A
没有合适的资源?快使用搜索试试~ 我知道了~
实现IOS动画侧边栏效果框架
共99个文件
h:22个
m:22个
png:16个
2星 需积分: 9 38 下载量 110 浏览量
2015-06-12
15:02:27
上传
评论
收藏 288KB ZIP 举报
温馨提示
本框架是类似于QQ、微信等的侧边栏效果框架,作者加入了绚丽的动画效果,更加吸引用户,而且本框架完全基于接口开发,充分考虑同学们在使用过程中的扩展和自定义!相当的绚丽,相当的人性化,值得集成!
资源推荐
资源详情
资源评论
收起资源包目录
MDMenuViewController.zip (99个子文件)
MDMenuViewController
.DS_Store 10KB
MDMenuViewController Documentation.pdf 58KB
MDMenuViewController Demo
ContactUsViewController.m 2KB
ContactUsViewController.h 295B
topBar.jpg 16KB
.DS_Store 8KB
FavouritViewController.xib 1KB
FavouritViewController.h 290B
phone-icon.png 2KB
ContactUsViewController.xib 2KB
AboutViewController.m 2KB
MDMenuViewController Demo.xcodeproj
project.xcworkspace
xcshareddata
MDMenuViewController Demo.xccheckout 2KB
contents.xcworkspacedata 170B
xcuserdata
meldehairy.xcuserdatad
UserInterfaceState.xcuserstate 21KB
donelaccount.xcuserdatad
UserInterfaceState.xcuserstate 17KB
guorongzhang.xcuserdatad
UserInterfaceState.xcuserstate 36KB
mrblue2020.xcuserdatad
UserInterfaceState.xcuserstate 46KB
xcuserdata
meldehairy.xcuserdatad
xcschemes
xcschememanagement.plist 587B
MDMenuViewController Demo.xcscheme 4KB
donelaccount.xcuserdatad
xcschemes
xcschememanagement.plist 587B
MDMenuViewController Demo.xcscheme 4KB
guorongzhang.xcuserdatad
xcschemes
xcschememanagement.plist 587B
MDMenuViewController Demo.xcscheme 4KB
mrblue2020.xcuserdatad
xcdebugger
Breakpoints_v2.xcbkptlist 9KB
xcschemes
xcschememanagement.plist 587B
MDMenuViewController Demo.xcscheme 4KB
project.pbxproj 44KB
MDMenuViewController Demo
MDMenuViewControllerDemoAppDelegate.m 6KB
.DS_Store 6KB
en.lproj
InfoPlist.strings 45B
main.m 416B
MDMenuViewController Demo-Info.plist 1KB
Images.xcassets
.DS_Store 6KB
LaunchImage.launchimage
Contents.json 1KB
AppIcon.appiconset
Contents.json 825B
MDMenuViewControllerDemoAppDelegate.h 356B
MDMenuViewController Demo-Prefix.pch 344B
backBtn.png 6KB
AdvisoryViewController.h 290B
concept-icon-poster60.png 214B
ServicesViewController.m 1KB
AboutViewController.xib 2KB
ServicesViewController.xib 3KB
AboutViewController.h 351B
AdvisoryViewController.m 2KB
AdvisoryViewController.xib 1KB
menu_icon.png 896B
icon_1320_white60.png 1KB
FavouritViewController.m 2KB
BigIcon_exclamation.gif 3KB
ServicesViewController.h 351B
MDMenuViewController DemoTests
.DS_Store 6KB
en.lproj
InfoPlist.strings 45B
MDMenuViewController_DemoTests.m 721B
MDMenuViewController DemoTests-Info.plist 697B
icon_back_white.png 375B
menu_icon (1).png 180B
MDMenuViewController 6KB
README.md 8KB
MDMenuViewController classes
MDMenuViewController.m 17KB
MDTransitionAnimatorSlideFromRight.h 342B
.DS_Store 6KB
MenuView.m 1KB
DefaultMenuView.m 9KB
MDTransitionAnimatorFactory.m 745B
MenuViewCellView.h 642B
MDStack.m 841B
TopBarView.h 921B
MDTransitionAnimatorNone.m 427B
MDMenuChildViewController.m 1KB
MDMenuViewController.h 2KB
MDMenuChildViewController.h 394B
MenuViewCellView.m 2KB
MDTransitionAnimatorSlideFromRight.m 1KB
MJPopupBackgroundView.m 995B
MDCellView.h 221B
MDTransitionAnimatorProtocol.h 482B
MDTransitionAnimatorFactory.h 521B
MDStack.h 379B
Default Images
side_menu@2x.png 392B
back_active@2x.png 597B
back@2x.png 592B
side_menu.png 209B
back.png 370B
back_active.png 376B
side_menu_active.png 209B
side_menu_active@2x.png 395B
DefaultMenuView.h 380B
MDTransitionAnimatorSlideFromLeft.h 340B
MDTransitionAnimatorSlideFromLeft.m 1KB
MDCellView.m 945B
MenuItemEntity.m 454B
MDMenuViewProtocol.h 803B
MJPopupBackgroundView.h 226B
MenuView.h 1020B
MDTransitionAnimatorNone.h 322B
TopBarView.m 4KB
MenuItemEntity.h 672B
threelines.png 2KB
共 99 条
- 1
资源评论
- kim逸云2016-03-25虽然写的还可以。但是没有一点注释。说实话,参考价值不大。
维庆
- 粉丝: 27
- 资源: 23
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功