DoActionSheetFork 1.1.2

DoActionSheetFork 1.1.2

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

beiliubei 维护。



  • beiliubei

DoActionSheet

UIActionSheet 的替代品:基于块,可自定义的主题,易于使用图片或地图

预览

带有标题,带有破坏性按钮,带有取消按钮和带有图片的

DoAlertView Screenshot

如果有很多按钮但取消按钮的位置是固定的,则支持滚动

DoAlertView Screenshot

可自定义颜色集

DoAlertView Screenshot

带有地图

DoAlertView Screenshot

要求

  • iOS 7.0 及更高版本
  • ARC

更新日志

1.1.1

  1. 启用自定义按钮

1.1.2

  1. 启用下划线

    @property (assign, nonatomic) BOOL underLineEnable;

示例

代码

DoActionSheet *vActionSheet = [[DoActionSheet alloc] init];
// required
vActionSheet.nAnimationType = _sgType.selectedSegmentIndex; // there are 3 type of animation

// optional
vActionSheet.dButtonRound = 2;  

// with image
vActionSheet.iImage = [UIImage imageNamed:@"pic1.jpg"];
vActionSheet.nContentMode = DoContentImage;


// with map
vActionSheet.nContentMode = DoContentMap;
vActionSheet.dLocation = @{@"latitude" : @(37.78275123), @"longitude" : @(-122.40416442), @"altitude" : @200};


// launch DoActionSheet! - With destructive button, cancel button and title
vActionSheet.nDestructiveIndex = 2;

[vActionSheet showC:@"What do you want for this photo?"
             cancel:@"Cancel"
            buttons:@[@"Post to facebook", @"Post to Instagram", @"Delete this photo"]
             result:^(int nResult) {

                 NSLog(@"---------------> result : %d", nResult);

             }];


// launch DoActionSheet! - With title and without cancel button
[vActionSheet show:@"What do you want?"
            buttons:@[@"Open with Safari", @"Copy the link"]
            result:^(int nResult) {

                NSLog(@"---------------> result : %d", nResult);

            }];
// customizable theme
#define DO_BACK_COLOR               DO_RGB(232, 229, 222)

// button background color
#define DO_BUTTON_COLOR             DO_RGB(158, 132, 103)
#define DO_CANCEL_COLOR             DO_RGB(240, 185, 103)
#define DO_DESTRUCTIVE_COLOR        DO_RGB(124, 192, 134)

// button text color
#define DO_TITLE_TEXT_COLOR         DO_RGB(95, 74, 50)
#define DO_BUTTON_TEXT_COLOR        DO_RGB(255, 255, 255)
#define DO_CANCEL_TEXT_COLOR        DO_RGB(255, 255, 255)
#define DO_DESTRUCTIVE_TEXT_COLOR   DO_RGB(255, 255, 255)

致谢

DoActionSheet 由 Dono Cho 创建。

许可

DoActionSheet 在 MIT 许可下提供。有关更多信息,请参阅 LICENSE 文件。