TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Jun 2016 |
Maintained by Aster0id.
TCXMenu
is an easy-to-use menu.
YCXMenu
folder into your project.
//set title
YCXMenuItem *menuTitle = [YCXMenuItem menuTitle:@"Menu" WithIcon:nil];
menuTitle.foreColor = [UIColor whiteColor];
menuTitle.titleFont = [UIFont boldSystemFontOfSize:20.0f];
//set logout button
YCXMenuItem *logoutItem = [YCXMenuItem menuItem:@"Logout" image:nil target:self action:@selector(logout:)];
logoutItem.foreColor = [UIColor redColor];
logoutItem.alignment = NSTextAlignmentCenter;
NSArray *items = @[menuTitle,
[YCXMenuItem menuItem:@"UserCenter"
image:nil
tag:100
userInfo:@{@"title":@"Menu"}],
[YCXMenuItem menuItem:@"CheckOut"
image:nil
tag:102
userInfo:@{@"title":@"Menu"}],
logoutItem
];
[YCXMenu showMenuInView:self.view fromRect:btn.frame menuItems:items selected:^(NSInteger index, YCXMenuItem *item) {
NSLog(@"%@",item);
}];
Menu显示/消失的通知不足以满足需要,现改为4个通知。
删除2个通知
新增4个通知
因为Menu控件整体使用类方法控制属性及显示/隐藏的操作。因此使用通知的方式获取Menu显示/消失等状态更为方便合理。
+(void)setMenuItemMarginY:
方法,可以根据此方法控制菜单中每个元素在垂直方向上的内边距值,默认 12.0f;+(void)setMenuItemMarginY:
, you can use this function to set item's margin, default 12.0f;+(void)setSeparatorColor:
方法,可以根据此方法控制分割线的颜色,默认 [UIColor colorWithRed:0.44 green:0.44 blue:0.44 alpha:1];+(void)setSeparatorColor:
, you can use this function to set menu's separator color, default [UIColor colorWithRed:0.44 green:0.44 blue:0.44 alpha:1];+(void)setCornerRadius:(CGFloat)cornerRadius;
方法,可以根据此方法控制选择的Item
圆角,默认 6.0f;Add function +(void)setCornerRadius:(CGFloat)cornerRadius;
, you can use this function to set item's corner radius, default 6.0f;
添加+(void)setArrowSize:(CGFloat)arrowSize;
方法,可以根据此方法控制选择的Item
箭头尺寸,默认 10.0f;
+(void)setArrowSize:(CGFloat)arrowSize;
, you can use this function to set item's arrow size, default 10.0f;+(UIColor*)setSelectedColor
方法,可以根据此方法控制选择的Item
颜色,默认蓝色;+(UIColor*)setSelectedColor;
,you can use this function to set item's selected Color,default blue;+(BOOL)isShow
方法, 可以根据此方法手动控制YCXMenu的显示和隐藏;+(BOOL)isShow
, you can set show or hide YCXMenu expediently;MIT License.