ZHPopupView 0.1.1

ZHPopupView 0.1.1

测试已测试
Lang语言 Obj-CObjective C
许可证 MIT
发布上次发布2016年5月

zhhlmr维护。



  • zhhlmr

一个简单的 iOS 弹窗视图,用于显示警告或对话框

Alt text

使用

警报视图
ZHPopupView *popupView = [ZHPopupView popupNomralAlertViewInView:nil
                                                 backgroundStyle:ZHPopupViewBackgroundType_SimpleOpacity
                                                           title:@"Tips"
                                                         content:@"Confirm to delete/remove?"
                                                    buttonTitles:@[@"Cancel", @"Confirm"]
                                             confirmBtnTextColor:nil otherBtnTextColor:nil
                                              buttonPressedBlock:^(NSInteger btnIdx) {


                                              }];
[popupView present];
对话框视图
ZHPopupView *popupView = [ZHPopupView popUpDialogViewInView:nil
                                                    iconImg:[UIImage imageNamed:@"correct_icon"]
                                            backgroundStyle:ZHPopupViewBackgroundType_SimpleOpacity
                                                      title:@"Lorem Ipsum"
                                                    content:kRandomText
                                               buttonTitles:@[@"Cancel", @"Confirm"]
                                        confirmBtnTextColor:nil otherBtnTextColor:nil
                                         buttonPressedBlock:^(NSInteger btnIdx) {


                                         }];
[popupView present];

属性

@property(nonatomic, strong) NSString *headTitle;// Title string
@property(nonatomic, strong) NSString *content; // Content String
@property(nonatomic, strong) UIImage *headIconImg; // head Icon Img

@property(nonatomic, strong) UIColor *headTitleColor; // Title Color
@property(nonatomic, strong) UIColor *contentTextColor; // Content Text Color

@property(nonatomic, assign) CGFloat headTitleFontSize;// Title font size
@property(nonatomic, assign) CGFloat contentTextFontSize;// Content font size

@property(nonatomic, assign) NSTextAlignment contentTextAlignment;// Content text Alignment
@property(nonatomic, assign) NSTextAlignment headTextAlignment; // Title Text Alignment



回调


@property(nonatomic, copy) void (^buttonPressedBlock)(NSInteger btnIdx); // Button Click/Pressed callback

背景显示类型


typedef enum {

    ZHPopupViewBackgroundType_SimpleOpacity = 0, // Default
    ZHPopupViewBackgroundType_Blur = 1 // With Radius 10.0f , will adding setting property about blur effect

} ZHPopupViewBackgroundType;

示例

要运行示例项目,请克隆仓库,并首先从 Example 目录运行 pod install

要求

安装

ZHPopupView 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中

pod "ZHPopupView"

作者

zhhlmr[email protected]

许可证

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