草庐IT

uialertview

全部标签

iphone - 单击 UIAlertView 时崩溃

当我点击UIAletView时,我收到以下错误。alertView:clickedButtonAtIndex:]:messagesenttodeallocatedinstance0x84c7010这是我用过的代码。UIAlertView*testAlert=[[UIAlertViewalloc]initWithTitle:messageTitlemessage:messageBodydelegate:selfcancelButtonTitle:messageCloseotherButtonTitles:messageTryAgain,nil];testAlert.tag=2;[test

iphone - 一段时间后显示 UIAlertView

我试图在一段时间后显示UIAlertView(比如在应用程序中执行某些操作后5分钟)。如果应用程序已关闭或处于后台,我已经通知用户。但是我想在应用程序运行时显示一个UIAlertView。我尝试按如下方式发送dispatch_async,但警报一直弹出:[NSThreadsleepForTimeInterval:minutes];dispatch_async(dispatch_get_main_queue(),^{UIAlertView*alert=[[UIAlertViewalloc]initWithTitle:@"title!"message:@"message!"delegate

iphone - UIAlertView 能否通过委托(delegate)传递字符串和 int

我有一个UIAlertView(实际上有几个),我正在使用方法-(void)alertView:(UIAlertView*)alertViewclickedButtonAtIndex:(NSInteger)buttonIndex来触发一个Action,如果用户不按取消。这是我的代码:-(void)doStuff{//complicatedtimeconsumingcodeheretoproduce:NSString*mySecretString=[selfcomplicatedRoutine];intmyInt=[selfotherComplicatedRoutine];UIAlert

ios - 更改 UIAlertView 大小

在我的cocos2d游戏中,我不能改变uialertview的大小,我已经将statusbarorientation更改为横向,现在想用f​​rame初始化alertview,而initwithframe方法不影响alertview的大小,每次alert的大小是一样,有什么办法可以改变吗? 最佳答案 这就是我所做的。在您的Controller中创建您的uialertview。然后在你的Controller中覆盖以下类(在设置uialertview委托(delegate)之后......即myalertview.delegate=vi

iphone - 如何从主视图中删除 UIAlertview

在我正在开发的应用程序中,我显示了一个UIAlertView。使用NSTimer我删除了调用方法removeFromSuperView的警报。警报已删除,但随后任何控件都适用于当前View。任何人都可以帮助我如何解决它?这是我显示警报的代码:UIAlertView*alert=[UIAlertViewalloc]initWithTitle:@"A"message:@"B"delegate:selfcancelButtonTitle:nilotherButtonTitles:nil,nil];[alertshow];[alertrelease];[NSTimerscheduledTime

ios - 显示键盘时 UIAlertView 消息未正确显示

UIAlertView消息在编辑其中的文本字段时(显示键盘时)无法正确显示。它是这样的:当键盘不存在时:这是创建警报View的代码:UIAlertView*alertView=[[UIAlertViewalloc]initWithTitle:@"Title"message:@"Enteranameforyourrecipe"delegate:selfcancelButtonTitle:@"Cancel"otherButtonTitles:@"OK",nil];[alertViewsetAlertViewStyle:UIAlertViewStylePlainTextInput];[ale

iOS 8 今天的小部件 - UIAlertView

是否可以将UIAlertView之类的东西添加到今天的小部件中?我向Widget添加了一个IBAction和一个UIAlertView,但没有任何反应。是否有可能制作更大的小部件?我在Size-Inspector中更改了高度,但它根本不起作用。 最佳答案 简短的回答是否定的,您不能在今天的小部件中显示警报。UIAlertControllers以模态方式呈现,您的小部件无法访问整个屏幕。它有大约3/4的屏幕高度可以显示。 关于iOS8今天的小部件-UIAlertView,我们在StackO

ios - 转发 UIAlertView 的可变参数

我正在尝试设置一个非常简单的UIAlertView,其中包含文本编辑、确定和取消按钮,我想根据文本编辑的内容禁用确定按钮。为了能够保留委托(delegate),以便他不会在警报View之前离开(从而在用户对警报View执行某些操作时立即导致崩溃),我对其进行了子类化。现在,我希望能够将otherButtonTitles参数从我的init方法转发到UIAlertViewinit方法,但出于某些原因,只需这样做:-(id)initWithTitle:(NSString*)titlemessage:(NSString*)messagedelegate:(id/**/)delegatecanc

iphone - UIAlertView 操作和取消按钮

我一直在研究和分析,我意识到UIAlertView中的按钮在按钮和操作之间没有相似性。左侧按钮执行主要操作,右侧按钮关闭警报。左键关闭警报,右键执行主要操作。在文档中,“cancelButtonTitle”(右按钮)是取消按钮的标题,但它并没有说明这个按钮是否真的是解除警报的按钮或那个按钮执行主要操作。好吧,我的问题是:是否有关于按钮的模式或任何人都可以执行任何操作? 最佳答案 来自AppleHIG:Abuttonthatinitiatesanactionisfurthesttotheright.Thisrightmostbutto

ios - UIAlertView 不打开 url?

我创建了一个带有三个按钮的警报View——“注册”、“捐赠”、“取消”——当你点击注册或捐赠时,safari应该打开特定的网站。但是,当我打开应用程序并单击任何按钮时,Safari不会打开或执行任何操作,并且按钮的工作方式就像它们是取消按钮的不同版本一样。这是我的代码:在BlahBlah.h中:@interfaceBlahBlah:UIViewController{}@end在BlahBlah.m中:#definedonate_tag0#import"BlahBlah.h"@implementationBlahBlah...-(void)donate{UIAlertView*alert