iOS资源库iOS DeveloperiOS 开发

显示UIAlertView和UIActionSheet的开源框架

2014-10-28  本文已影响265人  ch32053

use to display "UIAlertView" and "UIActionSheet” , that support iOS8 and iOS8 before

When you use "UIAlertView" and "UIActionSheet” in iOS8,screen direction changed lead to view show abnormal.

As you can see
UIActionSheet
UIAlertView
In iOS8 after,system provide a new class UIAlertController replace UIAlertView and UIActionSheet.
If you need support iOS8 before,you can use FYAlertManage to support iOS8 and iOS8 before.

It provides:

How To Use

Display a UIAlertView

<pre><code>
FYAlertManage *alertMan = [[FYAlertManage alloc] initWithTitle:@"提示" message:@"内容" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"第一个按钮",@"第一个按钮",nil];
[alertMan show];
#if ! __has_feature(objc_arc) [alertMan release]; #endif
</pre></code>

Display a UIAlertView with Login And Password Input

<pre><code>
FYAlertManage *alertMan = [[FYAlertManage alloc] initWithTitle:@"提示" message:@"请输入内容和密码" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定",nil];
alertMan.alertViewStyle = UIAlertViewStyleLoginAndPasswordInput;
alertMan.tag = 333;
[alertMan show];
#if ! __has_feature(objc_arc) [alertMan release];#endif
</pre></code>

Display a UIActionSheet

<pre><code>
FYAlertManage *alertMan = [[FYAlertManage alloc] initWithTitle:@"提示" delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:@"特别提醒按钮" otherButtonTitles:@"第一个按钮",nil];
[alertMan showInView:self.view];
#if ! __has_feature(objc_arc) [alertMan release];#endif
</pre></code>

下载地址:https://github.com/wangyangcc/FYAlertManage

上一篇 下一篇

猜你喜欢

热点阅读