REMenu 1.10

REMenu 1.10

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布于最后发布2014年12月

Roman Efimov 维护。



REMenu 1.10

  • 作者
  • Roman Efimov

受 Vine 启发的下拉菜单。

REMenu Screenshot REMenu Screenshot

要求

  • Xcode 5 或更高版本
  • Apple LLVM 编译器
  • iOS 6.0 或更高版本
  • ARC

演示

在 Xcode 中构建并运行 REMenuExample 项目,以查看 REMenu 的实际应用。

安装

手动安装

您只需将 REMenu 文件放入您的项目中,并在将使用它的类中添加 #include "REMenu.h"

示例用法

REMenuItem *homeItem = [[REMenuItem alloc] initWithTitle:@"Home"
                                                  subtitle:@"Return to Home Screen"
                                                     image:[UIImage imageNamed:@"Icon_Home"]
                                          highlightedImage:nil
                                                    action:^(REMenuItem *item) {
                                                        NSLog(@"Item: %@", item);
                                                    }];

REMenuItem *exploreItem = [[REMenuItem alloc] initWithTitle:@"Explore"
                                                   subtitle:@"Explore 47 additional options"
                                                      image:[UIImage imageNamed:@"Icon_Explore"]
                                           highlightedImage:nil
                                                     action:^(REMenuItem *item) {
                                                         NSLog(@"Item: %@", item);
                                                     }];

REMenuItem *activityItem = [[REMenuItem alloc] initWithTitle:@"Activity"
                                                    subtitle:@"Perform 3 additional activities"
                                                       image:[UIImage imageNamed:@"Icon_Activity"]
                                            highlightedImage:nil
                                                      action:^(REMenuItem *item) {
                                                          NSLog(@"Item: %@", item);
                                                      }];

REMenuItem *profileItem = [[REMenuItem alloc] initWithTitle:@"Profile"
                                                      image:[UIImage imageNamed:@"Icon_Profile"]
                                           highlightedImage:nil
                                                     action:^(REMenuItem *item) {
                                                         NSLog(@"Item: %@", item);
                                                     }];

self.menu = [[REMenu alloc] initWithItems:@[homeItem, exploreItem, activityItem, profileItem]];
[self.menu showFromNavigationController:self.navigationController];

您也可以从自定义视图呈现 REMenu,为此有2个特定的任务

- (void)showFromRect:(CGRect)rect inView:(UIView *)view;
- (void)showInView:(UIView *)view;

从版本 1.3 开始,您可以为项目分配自定义视图,如下所示

UIView *customView = [[UIView alloc] init];
customView.backgroundColor = [UIColor blueColor];
customView.alpha = 0.4;
REMenuItem *customViewItem = [[REMenuItem alloc] initWithCustomView:customView action:^(REMenuItem *item) {
    NSLog(@"Tap on customView");
}];

自定义

您可以自定义 REMenu 的以下属性

@property (assign, readwrite, nonatomic) CGFloat cornerRadius;
@property (strong, readwrite, nonatomic) UIColor *shadowColor;
@property (assign, readwrite, nonatomic) CGSize shadowOffset;
@property (assign, readwrite, nonatomic) CGFloat shadowOpacity;
@property (assign, readwrite, nonatomic) CGFloat shadowRadius;
@property (assign, readwrite, nonatomic) CGFloat itemHeight;
@property (strong, readwrite, nonatomic) UIColor *backgroundColor;
@property (strong, readwrite, nonatomic) UIColor *separatorColor;
@property (assign, readwrite, nonatomic) CGFloat separatorHeight;
@property (strong, readwrite, nonatomic) UIFont *font;
@property (strong, readwrite, nonatomic) UIColor *textColor;
@property (strong, readwrite, nonatomic) UIColor *textShadowColor;
@property (assign, readwrite, nonatomic) CGSize imageOffset;
@property (assign, readwrite, nonatomic) CGSize textOffset;
@property (assign, readwrite, nonatomic) CGSize textShadowOffset;
@property (strong, readwrite, nonatomic) UIColor *highlightedBackgroundColor;
@property (strong, readwrite, nonatomic) UIColor *highlightedSeparatorColor;
@property (strong, readwrite, nonatomic) UIColor *highlightedTextColor;
@property (strong, readwrite, nonatomic) UIColor *highlightedTextShadowColor;
@property (assign, readwrite, nonatomic) CGSize highlightedTextShadowOffset;
@property (assign, readwrite, nonatomic) CGFloat borderWidth;
@property (strong, readwrite, nonatomic) UIColor *borderColor;
@property (assign, readwrite, nonatomic) NSTextAlignment textAlignment;
@property (strong, readwrite, nonatomic) UIFont *subtitleFont;
@property (strong, readwrite, nonatomic) UIColor *subtitleTextColor;
@property (strong, readwrite, nonatomic) UIColor *subtitleTextShadowColor;
@property (assign, readwrite, nonatomic) CGSize subtitleTextOffset;
@property (assign, readwrite, nonatomic) CGSize subtitleTextShadowOffset;
@property (strong, readwrite, nonatomic) UIColor *subtitleHighlightedTextColor;
@property (strong, readwrite, nonatomic) UIColor *subtitleHighlightedTextShadowColor;
@property (assign, readwrite, nonatomic) CGSize subtitleHighlightedTextShadowOffset;
@property (assign, readwrite, nonatomic) NSTextAlignment subtitleTextAlignment;
@property (assign, readwrite, nonatomic) NSTimeInterval animationDuration;
@property (assign, readwrite, nonatomic) NSTimeInterval bounceAnimationDuration;
@property (assign, readwrite, nonatomic) REMenuImageAlignment imageAlignment;
@property (assign, readwrite, nonatomic) BOOL appearsBehindNavigationBar;
@property (assign, readwrite, nonatomic) BOOL bounce;
@property (assign, readwrite, nonatomic) BOOL liveBlur; // Available only in iOS 7
@property (strong, readwrite, nonatomic) UIColor *liveBlurTintColor; // Available only in iOS 7
@property (assign, readwrite, nonatomic) REMenuLiveBackgroundStyle liveBlurBackgroundStyle; // Available only in iOS 7
@property (copy, readwrite, nonatomic) void (^badgeLabelConfigurationBlock)(UILabel *badgeLabel, REMenuItem *item);

联系方式

Roman Efimov

许可证

REMenu 使用 MIT 许可证。

版权 © 2013 Roman Efimov。

任何人未经限制地使用该软件及其相关文档文件(“软件”)的权利,包括但不限于使用、复制、修改、合并、出版、分发、再许可和/或出售副本来获取软件复制件和与软件相关的文档文件的权利,并允许接收软件的人如此行,前提是

上述版权声明和本许可声明应包含在软件或其实质性部分的副本中。

软件按“原样”提供,不提供任何明示或暗示保证,包括但不限于适用性、特定用途和侵权保证。在任何情况下,作者或版权所有者不应对任何索赔、损害或其他责任承担责任,无论是因为合同、侵权或其他方式,无论是否从、因或与软件或其使用或其他交易有关。