8 Star 23 Fork 9

杜耀辉 / AlertView

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Logo RAlertView ios弹窗

AlertView 是一个ios弹窗框架,可以很简单的集成到自己的项目内,支持pod.

Shippable CocoaPods Packagist email

动画预览

Warning content

安装

  • 手动安装依赖 MasonryHexColors 框架,如果项目没有引入请导入这两个框架
  • 在需要的地方导入:#import "RAlertView.h" 你懂的

cocoapods 安装

pod 'RAlertView'

弹窗类型 AlertStyle

typedef NS_ENUM(NSInteger,AlertStyle) {
    SimpleAlert = 0,
    ConfirmAlert,
    CancelAndConfirmAlert,
};

RAlertView Preview

弹窗主题效果 AlertTheme

   RAlertView *alert = [[RAlertView alloc] initWithStyle:CancelAndConfirmAlert];
   alert.theme =[UIColor redColor];

RAlertView Preview

一些属性设置

  • 设置单击背景或者任意位置都可以关闭弹窗
alert.isClickBackgroundCloseWindow = YES;
  • 设置弹窗内容的文字的对齐是否居中
alert.contentTextLabel.text =@"SimpleAlert \nAlertView A pop-up framework, Can be simple and convenient to join your project";

alert.contentTextLabel.attributedText = [TextHelper attributedStringForString:@"AlertView A pop-up framework, Can be simple and convenient to join your project" lineSpacing:5];

初始化弹窗 RAlertView

  • 按照样式初始化 initWithStyle AlertStyle
RAlertView *alert = [[RAlertView alloc] initWithStyle:SimpleAlert];
  • 按照样式和宽度初始化 width的值可以设置0-1表示小对于屏幕宽度的百分比,如果大于1的值则按照px像素处理 initWithStyle AlertStyle and width
RAlertView *alert = [[RAlertView alloc] initWithStyle:SimpleAlert width:0.8];

SimpleAlert

RAlertView *alert = [[RAlertView alloc] initWithStyle:SimpleAlert width:0.8];
alert.isClickBackgroundCloseWindow = YES;
alert.contentTextLabel.text =@"SimpleAlert \nAlertView A pop-up framework, Can be simple and convenient to join your project";

ConfirmAlert

RAlertView *alert = [[RAlertView alloc] initWithStyle:ConfirmAlert];
alert.headerTitleLabel.text = @"ConfirmAlert";
alert.contentTextLabel.attributedText = [TextHelper attributedStringForString:@"AlertView A pop-up framework, Can be simple and convenient to join your project" lineSpacing:5];
[alert.confirmButton setTitle:@"Ok" forState:UIControlStateNormal];
alert.confirm = ^(){
        NSLog(@"Click on the Ok");
   };

CancelAndConfirmAlert

RAlertView *alert = [[RAlertView alloc] initWithStyle:CancelAndConfirmAlert];
alert.headerTitleLabel.text = @"CancelAndConfirmAlert";
alert.contentTextLabel.attributedText = [TextHelper attributedStringForString:@"AlertView A pop-up framework, Can be simple and convenient to join your project" lineSpacing:5];;
[alert.confirmButton setTitle:@"Ok" forState:UIControlStateNormal];
[alert.cancelButton setTitle:@"Cancel" forState:UIControlStateNormal];
alert.confirm = ^(){
        NSLog(@"Click on the Ok");
   };
alert.cancel = ^(){
        NSLog(@"Click on the Cancel");
   };

期待

  • 如果在使用过程中遇到BUG,希望你能Issues我,谢谢(或者尝试下载最新的框架代码看看BUG修复没有)
  • 如果在使用过程中发现功能不够用,希望你能Issues我,我非常想为这个框架增加更多好用的功能,谢谢
  • 如果你想为RAlertView输出代码,请拼命Pull Requests我

排版规范参考 https://github.com/sparanoid/chinese-copywriting-guidelines

Copyright (c) 2012 - 2016, GitHub, Inc. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

AlertView A pop-up framework, Can be simple and convenient to join your project. 展开 收起
Objective-C
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Objective-C
1
https://gitee.com/roycms/AlertView.git
git@gitee.com:roycms/AlertView.git
roycms
AlertView
AlertView
master

搜索帮助