Tag: uialertview

在iOS 8之后,我可以继续使用UIActionSheet和U​​IAlertView吗?

我有使用UIActionSheet和UIAlertView应用程序。 在iOS8中,苹果公司的文档和一些网站表示,它们在iOS8中被弃用。 UIActionSheet文档 重要提示:UIActionSheet在iOS 8中已弃用。(请注意,UIActionSheetDelegate也被弃用。)要在iOS 8及更高版本中创build和pipe理操作表,请使用带有UIAlertControllerStyleActionSheet的preferredStyle的UIAlertController。 但在Xcode 6中,部署目标8.0不会为使用UIActionSheet和UIAlertView生成警告。 通常,Xcode会为已弃用的API生成警告。 为什么Xcode不为UIActionSheet和UIAlertView产生警告? 这是否意味着苹果实际上并不赞成这些类? 如果他们实际上不赞成他们,Xcode不会产生警告是非常危险的。 在另一个苹果的文档“iOS 8.0新增function”中说: 新的UIAlertController类replaceUIActionSheet和UIAlertView类作为在您的应用程序中显示警报的首选方式。 https://developer.apple.com/library/ios/releasenotes/General/WhatsNewIniOS/Articles/iOS8.html UIActionSheet和UIAlertView未在上述URL文档的“ 弃用API”部分列出。 所以,这个文档意味着UIAlertController是可取的,但UIActionSheet和UIAlertView在iOS 8中也是可用的。 我应该用新的UIAlertController类来replace我的应用程序中的UIActionSheet和UIAlertView吗? 或者我可以继续使用UIActionSheet和UIAlertView ?

IOS:两个UIAlert和两个不同的委托方法

我有一个UIAlert UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"ok" message:@"Canc?" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:@"Annul", nil]; [alertView show]; [alertView release]; 及其委托方法: – (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { if(buttonIndex == 0)//OK button pressed { //do something } else if(buttonIndex == 1)//Annul button pressed. { //do something } 这一切都ok,但如果我有另一个alertview示例“alertViewOne”,我希望这个alertViewOne有它的委托方法,它不应该使用第一个alertview的委托方法; 如何更改我的代码?

用UIAlertView以编程方式退出iOS应用程序

我通过下面的方法中止我的iOS应用程序 -(void)cancelSelected { UIAlertView * alert = [[UIAlertView alloc] initWithTitle:nil message:@"Are you sure you want to exit?" delegate:self cancelButtonTitle:@"No" otherButtonTitles:@"Yes", nil]; [alert show]; alert = nil; } 方法1: -(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { if (buttonIndex) abort(); } 方法2: -(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { if (buttonIndex) [NSException raise:@"Disagree terms and conditions." format:@"Quit, Cancel"]; } 我应该这样做以编程方式退出我的iOS应用程序? 这个abort()方法会导致拒绝我的应用程序吗? 谢谢!

iOS开发:通过在Alert中按下button来争论?

我一直在寻找几个小时,还没有find任何答案,所以我会很感激你的帮助! 我正在devise一个应用程序,当按下一个警报button时,需要继续到不同的视图控制器。 我已经设置了警报,但只需要代码继续到一个新的观点。

在后台线程正在加载数据时挂起UIAlertview

我有一个名为“刷新数据”的UIBarButtonItem。 当用户点击它时,应用程序应刷新其数据。 点击这个button会发生什么事情,Web服务被启动,XML数据被带入,它们的顺序为30000-40000条logging。 所以为了防止UI挂起我写了一个后台线程,并在那里加载。 – (void)refreshDataAction { NSLog(@"Refresh Data"); //Put up an alert box indicating user to wait while data is loading. UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Data is Loading" message:@"Please wait while data is being refreshed." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; alert.tag = 10; [alert show]; } – (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { NSLog(@"hit in clickedbuttonatindex […]

iOS 5 UIAlertView自定义

我将UIButton添加到UIAlertView中,如下所示 iOS 6以及iOS 7以下的版本都是如此 请让我们知道如何解决这个问题。

当用户点击特定的date时,将会显示一个提醒标题

我正在使用SAcalendar。 这是我的JSON: data: – [ – { id: "1", event_start: "2014-06-09 11:30", event_end: "2014-06-09 12:30", title: "Click a date to create a new event and drag to change its date and time. Click on an existing event to modify. Click "Show Standard Settings" to set additional event properties." }, – { id: "2", event_start: "2017-01-03 […]

在警报视图中,如何更改背景颜色并显示视图的底部?

我想更改UIAlertView视图背景颜色并更改警报视图的显示位置。 它是否可行?

添加视图作为应用程序顶层窗口的子视图时,警报视图不可见

我有一个情况,我把我的商店视图作为顶部窗口的子视图。 这是通过以下代码完成的: NSArray* windows = [[UIApplication sharedApplication] windows]; int count = [windows count]; UIWindow* topWindow = [windows objectAtIndex:count – 1]; [topWindow addSubview:_storeView]; 当我购买产品时,在某些情况下(不确定何时以及为什么)应用程序内购买提醒,用户需要input其应用程序ID凭证并批准该交易的信息由我的视图覆盖,并且对于用户。 只有当我解雇我的看法,我可以看到他们,并完成购买stream程。 我怎样才能确保这些警报将出现在所有其他意见的顶部。 为什么它不一致,在某些情况下,它是用户可见的,在某些情况下,它不是… 感谢任何帮助。

iOS 7:在UIActionSheet委托函数中创build的UIAlertView不能自动旋转

这个问题只能在iOS 7中重现。 在委托函数中: – (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex ,如果创build了UIAlertView,则警报视图不能自动旋转。 这里是示例代码: – (IBAction)buttonTapped:(id)sender { UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"action sheet" delegate:self cancelButtonTitle:@"cancel" destructiveButtonTitle:@"ok" otherButtonTitles:nil]; [actionSheet showInView:self.view]; } – (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"alert" message:nil delegate:self cancelButtonTitle:@"ok" otherButtonTitles:nil]; [alert show]; } 这是iOS 7的错误吗? 如果是的话,有什么办法让警报视图自动旋转与屏幕上的其他视图?