LSActionView 1.0.0

LSActionView 1.0.0

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布时间最后发布时间2015年2月

lslin 维护。



基于 UIActionSheet 的一个基于块和可自定义的外观。

安装

  • LSActionView.hLSActionView.m 添加到您的项目中。
  • 在您想要使用的地方添加 #import "LSActionView.h"

要求

需要 iOS 4.3 及以上。

使用方法

  #import "LSActionView.h"

  - (void)onShareTapped:(id)sender {

    //show without button title
    NSArray *images = @[@"icon_dropbox", @"icon_rss", @"icon_facebook", @"icon_twitter"];
    [[LSActionView sharedActionView] showWithImages:images actionBlock:^(NSInteger index) {
        NSLog(@"Action trigger at %ld:", (long)index);
    }]; 

    //show with button title
    NSArray *titles = @[@"Dropbox", @"Rss", @"Facebook", @"Twitter"];
    [[LSActionView sharedActionView] showWithImages:images titles:titles actionBlock:^(NSInteger index) {
        NSLog(@"Action trigger at %ld:", (long)index);
    }];                                             
  }

可定制

  @property (strong, nonatomic) UIColor *blankAreaColor;
  @property (strong, nonatomic) UIColor *containerColor;
  @property (strong, nonatomic) UIColor *buttonTitleColor;
  @property (assign, nonatomic) CGFloat buttonFontSize;
  @property (assign, nonatomic) CGFloat containerMargin;
  @property (assign, nonatomic) CGFloat buttonIconWidth;
  @property (assign, nonatomic) CGFloat buttonTitleHeight;

示例

无标题

LSActionView Example1

有标题

LSActionView Example2

横幅

LSActionView Example3