66// Copyright (c) 2018 MrDML. All rights reserved.
77//
88
9+ #define MLClolor (r,g,b,a ) [UIColor colorWithRed: r/255.0 green: g/255.0 blue: b/255.0 alpha: a]
10+ #define k_ScreenHeight [UIScreen mainScreen ].bounds.size.height
11+ #define k_ScreenWidth [UIScreen mainScreen ].bounds.size.width
12+ #define k_StatusBarHeight [UIApplication sharedApplication ].statusBarFrame.size.height
13+ #define k_NavigationBarHeight 44 .f
14+ #define k_StatusBarAndNavigationBarHeight (k_StatusBarHeight + k_NavigationBarHeight)
915#import " MLViewController.h"
10- #import < MLMenu/MLMenu .h>
16+ #import < MLMenu/MLMenuView .h>
1117@interface MLViewController ()
1218
1319@end
@@ -47,7 +53,14 @@ - (void)testCode_One
4753{
4854 NSArray *titles = @[@" 发起群聊" ,@" 添加朋友" ,@" 扫一扫" ,@" 收付款" ];
4955
50- MLMenuView *menuView = [[MLMenuView alloc ] initWithFrame: CGRectMake ([UIScreen mainScreen ].bounds.size.width - 100 - 10 , 0 , 100 , 44 * 4 ) WithTitles: titles WithImageNames: nil WithMenuViewOffsetTop: k_StatusBarAndNavigationBarHeight WithTriangleOffsetLeft: 80 ];;
56+ MLMenuView *menuView = [[MLMenuView alloc ] initWithFrame: CGRectMake ([UIScreen mainScreen ].bounds.size.width - 100 - 10 , 0 , 100 , 44 * 4 ) WithTitles: titles WithImageNames: nil WithMenuViewOffsetTop: k_StatusBarAndNavigationBarHeight WithTriangleOffsetLeft: 80 triangleColor: [UIColor whiteColor ]];
57+ menuView.separatorOffSet = 10 ;
58+ menuView.separatorColor = MLClolor (51 , 51 , 51 , 1 );
59+ [menuView setMenuViewBackgroundColor: [UIColor whiteColor ]];
60+ menuView.titleColor = [UIColor blackColor ];
61+
62+
63+ [menuView setCoverViewBackgroundColor: MLClolor (51 , 51 , 51 , 0.5 )];
5164 menuView.didSelectBlock = ^(NSInteger index) {
5265 NSLog (@" %zd " ,index);
5366 };
@@ -60,7 +73,7 @@ - (void)testCode_Two
6073 NSArray *titles = @[@" 发起群聊" ,@" 添加朋友" ,@" 扫一扫" ,@" 收付款" ];
6174 NSArray *images = @[@" scan" ,@" scan" ,@" scan" ,@" scan" ];
6275
63- MLMenuView *menuView = [[MLMenuView alloc ] initWithFrame: CGRectMake ([UIScreen mainScreen ].bounds.size.width - 100 - 10 , 0 , 100 , 44 * 4 ) WithTitles: titles WithImageNames: images WithMenuViewOffsetTop: k_StatusBarAndNavigationBarHeight WithTriangleOffsetLeft: 80 ];
76+ MLMenuView *menuView = [[MLMenuView alloc ] initWithFrame: CGRectMake ([UIScreen mainScreen ].bounds.size.width - 100 - 10 , 0 , 100 , 44 * 4 ) WithTitles: titles WithImageNames: images WithMenuViewOffsetTop: k_StatusBarAndNavigationBarHeight WithTriangleOffsetLeft: 80 triangleColor: nil ];
6477 [menuView setCoverViewBackgroundColor: [UIColor lightGrayColor ]];
6578 menuView.didSelectBlock = ^(NSInteger index) {
6679 NSLog (@" %zd " ,index);
@@ -73,7 +86,7 @@ - (void)testCode_Three
7386{
7487 NSArray *titles = @[@" 发起群聊" ,@" 添加朋友" ,@" 扫一扫" ,@" 收付款" ];
7588 NSArray *images = @[@" scan" ,@" scan" ,@" scan" ,@" scan" ];
76- MLMenuView *menuView = [[MLMenuView alloc ] initWithFrame: CGRectMake ([UIScreen mainScreen ].bounds.size.width - 100 - 10 , 0 , 100 , 44 * 4 ) WithTitles: titles WithImageNames: images WithMenuViewOffsetTop: k_StatusBarAndNavigationBarHeight WithTriangleOffsetLeft: 80 ];
89+ MLMenuView *menuView = [[MLMenuView alloc ] initWithFrame: CGRectMake ([UIScreen mainScreen ].bounds.size.width - 100 - 10 , 0 , 100 , 44 * 4 ) WithTitles: titles WithImageNames: images WithMenuViewOffsetTop: k_StatusBarAndNavigationBarHeight WithTriangleOffsetLeft: 80 triangleColor: nil ];
7790 menuView.didSelectBlock = ^(NSInteger index) {
7891 NSLog (@" %zd " ,index);
7992 };
@@ -97,7 +110,7 @@ - (void)testCode_Five
97110{
98111 NSArray *titles = @[@" 发起群聊" ,@" 添加朋友" ,@" 扫一扫" ,@" 收付款" ];
99112
100- MLMenuView *menuView = [[MLMenuView alloc ] initWithFrame: CGRectMake ([UIScreen mainScreen ].bounds.size.width - 100 - 10 , 0 , 100 , 44 * 4 ) WithTitles: titles WithImageNames: nil WithMenuViewOffsetTop: k_StatusBarAndNavigationBarHeight WithTriangleOffsetLeft: 80 ];
113+ MLMenuView *menuView = [[MLMenuView alloc ] initWithFrame: CGRectMake ([UIScreen mainScreen ].bounds.size.width - 100 - 10 , 0 , 100 , 44 * 4 ) WithTitles: titles WithImageNames: nil WithMenuViewOffsetTop: k_StatusBarAndNavigationBarHeight WithTriangleOffsetLeft: 80 triangleColor: nil ];
101114 [menuView setCoverViewBackgroundColor: [UIColor lightGrayColor ]];
102115 menuView.didSelectBlock = ^(NSInteger index) {
103116 NSLog (@" %zd " ,index);
0 commit comments