默认的UIAlertView都有一个或者多个按钮,如果你想创建没有按钮的UIAlertView,可以使用以下方法:
UIAlertView *alert;
alert = [[[UIAlertView alloc] initWithTitle:@"\r\rConfiguring Preferences\rPlease Wait..."
message:nil delegate:self cancelButtonTitle:nil otherButtonTitles: nil] autorelease];
[alert show];
如果你还想给UIAlertView添加一个等待提示符,则可以这么做:
UIAlertView *alert;
alert = [[[UIAlertView alloc] initWithTitle:@"\r\rConfiguring Preferences\rPlease Wait..."
message:nil delegate:self cancelButtonTitle:nil otherButtonTitles: nil] autorelease];
[alert show];
UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
indicator.center = CGPointMake(alert.bounds.size.width / 2, alert.bounds.size.height - 50);
[indicator startAnimating];
[alert addSubview:indicator];
[indicator release];
因为这个UIAlertView没有按钮,所以就不能通过点击按钮将这个提示框去掉。可以通过程序的方式,将这个窗口关掉。
[alert dismissWithClickedButtonIndex:0 animated:YES];
分享到:
相关推荐
UIAlertView-块短此类别将为UIAlertView创建,这将有助于用一行创建UIAlertView。 用户几乎没有选择。带有块的UIAlertView 不再需要使用委托方法。 用户可以使用Block创建UIAlertView。 用户传递参数时,必须以数组...
为了防止删除它,使用了私有单例类AlertManager ,它保存对所有创建的消息的引用,直到通过单击其中的按钮将其关闭。 此类还为每条消息生成唯一 ID。 第二个私有类称为MyButton并保存每个添加按钮的信息。 ...
LQPopUpView *popUpView = [[LQPopUpView alloc] initWithTitle:@"提示" message:@"这是第二种创建方式,也是一种快捷创建方式,没有太多的代码分离,使用起来特别方便,而且你可以单独再次加入任何按钮" ...
作为解决方案,此类创建一个iOS样式的对话框,您可以使用任何UIViews或按钮对其进行扩展。 动画和外观也被复制,不需要图像或其他资源。 安装 只需将以下文件添加到项目中即可: CustomIOSAlertView.h ...
1. 最简单的用法 初始化方法: 代码如下: – (instancetype)initWithTitle:(NSString *)title message:(NSString *)...这个方法通过设置一个标题,内容,代理和一些按钮的标题创建警告框,代码示例如下: UIAlertV
有两种创建view的方法,一种根据数组创建button,可以根据类似于UIAlertView的代理方法获取按钮的点击事件,也可以创建不带按钮的提示框,有1s、2s、3s三种显示时间
在iOS 9中,UIAlertController在功能上是和UIAlertView以及...同创建UIAlertView相比,我们无需指定代理,也无需在初始化过程中指定按钮。不过要特别注意第三个参数,要确定您选择的是对话框样式还是上拉菜单样式。
从GIF动画创建一个动态UIImages 对象 从上往下拉出现加载view,动态加载内容 从上往下拉动态加载 从上往下拉动态加载3 从下往上弹出的子视图窗口 从下往下拉进行列表内容动态加载 仿Instagram, Path, DailyBooth底部...
SDCAlertView最初是一个警报,看起来与UIAlertView相同,但是支持自定义内容视图。 随着iOS 8中UIAlertController的引入,该项目已更新为UIAlertController带来的更现代的API。 特征 大多数UIAlertController功能 ...
UIAlertView *alert =[[UIAlertView alloc] initWithTitle:@"hello" message:@"zhu" delegate:self cancelButtonTitle:@"ok" otherButtonTitles:nil]; [alert show]; } 8.右键单击View中添加的按钮分别添加...
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"警告" message:@"用户名不能为空" delegate:nil cancelButtonTitle:@"取消" otherButtonTitles:nil]; //show 展现 ,显示alertview [alertView ...
//创建一个UIBarButtonItem右边按钮 UIBarButtonItem *rightButton = [[UIBarButtonItem alloc] initWithTitle:@"右边" style:UIBarButtonItemStyleDone target:self action:@selector(clickRightButton)]; [self....