DoActionSheet 1.0

DoActionSheet 1.0

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

JackShi维护。



  • JackShi

UIActionSheet的替代品:基于块,可定制主题,易于与图像或地图使用

预览

带有标题,具有破坏性按钮,带有取消按钮,并带有图像

DoAlertView Screenshot

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

DoAlertView Screenshot

可定制的颜色集

DoAlertView Screenshot

带有地图

DoAlertView Screenshot

要求

  • iOS 7.0及以上
  • ARC

示例

代码

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文件以获取更多信息。