Tag: uialertview

UIAlertView更改背景颜色

您好我想要更改UiAlertview BG颜色为绿色,使用setBGcolor它给我下面的输出,其中有一个深色的SetBGColor指定,另一种方式来删除背景颜色或别的东西。

我如何显示从任何NSObject子类UIAlertController?

我有一个我正在pipe理的遗留代码库,它需要显示来自各地的警报消息。 这是可怕的做法,需要重构,但这不会很快发生。 在iOS 9中,我需要能够触发和忘记警报视图,并为我pipe理视图显示和排队。

appdelegate中的clickedButtonAtIndex不被调用

我使用MyApplicationAppDelegate.m文件中的两个button“取消”和“确定”来调用UIAlert,但只需点击“取消”或“确定”button -(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex 方法不被调用。 我在下面的MyapplicationAppDelegate.h文件中添加了UIAlertViewDelegate #import UIKit/UIKit.h @interface MyapplicationAppDelegate: NSObject UIApplicationDelegate,UIAlertViewDelegate { .. } 我想知道还有什么是必需的。

UIAutomation:Alert视图上的取消button被轻敲而不实际执行

我在UIAutomation面临这个奇怪的问题。 我正在检查一个警报。 在那里,我正在尝试logging警报标题和警报消息。 我的代码是这样的: UIATarget.onAlert = function onAlert(alert) { UIALogger.logMessage("alert Shown"); UIALogger.logMessage(frontApp.alert().name()); UIALogger.logMessage(frontApp.alert().staticTexts()[1].value()); } var target = UIATarget.localTarget().frontMostApp().mainWindow(); target.scrollViews()[0].buttons()["saveB"].tap(); UIATarget.localTarget().delay(2); 我不在点击取消button在警报解雇它。 但是,它正在自动挖掘。 我不知道为什么。 即使在logMessages中,我也看到了 target.frontMostApp().alert().cancelButton().tap() 这一行自动执行。 我的脚本文件中没有这行。 这是在iOS的错误?

如何显示在UIAlertView在iOS上的所有button正常字体的文本

在我的iOS项目,我有一个UIAlertView与3个button,但最后一个button的文本默认为粗体字体,像这样…我怎样才能设置正常的第三个button文字的字体样式? 以下是用于创build该警报视图的代码 UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"test" message:@"testTestTest" delegate:Nil cancelButtonTitle:nil otherButtonTitles:@"first",@"second",@"third" ,nil]; [alert show];

IOS以编程方式创buildUIAlertViewController

我正在使用代码(没有故事板)的ViewController。 我试图添加和AlertController 我在.m中声明propery @property (nonatomic, strong) UIAlertController *alertController; 并在loadview方法中初始化 //alertviewController _alertController = [[UIAlertController alloc]initWithNibName:nil bundle:nil]; 并在viewDidLoad调用alertview: _alertController = [UIAlertController alertControllerWithTitle:@"Error display content" message:@"Error connecting to server, no local database" preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction *ok = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { LandingPageViewController *viewController = [[LandingPageViewController alloc] initWithNibName:nil bundle:nil]; // viewController.showNavBarBackButton = YES; [[AppDelegate sharedAppDelegate].rootViewController cPushViewController:viewController]; […]

将自定义视图添加到警报视图

我有这样的问题: 我想在一个警报视图中显示一个自定义的视图。 所以我创build了一个单独的xib文件,并devise了我的界面,并为它实现了类。但是当我应用下面的代码时,它给了我一个错误。 这是代码: UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Confirm your Action" message:@"Click OK to confirm" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:@"Cancel",nil]; NSArray *subviewArray = [[NSBundle mainBundle] loadNibNamed:@"customDialogViewController" owner:self options:nil]; customDialogViewController *myView = (customDialogViewController*) [subviewArray objectAtIndex:0]; [alert setValue:myView forKey:@"accessoryView"]; //alert.alertViewStyle = UIAlertViewStylePlainTextInput; alert.tag = KAlertViewthree; [alert show]; 这是我的错误: Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'child view […]

正在要求<_UIPopoverBackgroundVisualEffectView>设置其不透明度

我试图显示(AlertController)操作表。 但是我在控制台中变得越来越弱了“<_UIPopoverBackgroundVisualEffectView 0x7fd65ef76ec0>被要求使其不透明度动起来,这会导致效果中断,直到不透明度返回到1。 这是我的代码: – extension GroupDataView { func callDot (sender : UIButton) { let alert = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet) alert.addAction(UIAlertAction(title: "Edit Group", style: .default , handler:{ (action)in print("User click Edit Group") })) alert.addAction(UIAlertAction(title: "Create Folder", style: .default , handler:{ (action)in print("User click Create Folder button") })) alert.addAction(UIAlertAction(title: "Delete Group", style: .destructive […]

你可以在Swift中创build匿名内部类吗?

我厌倦了将整个类声明为能够通过扩展UIAlertViewDelegate来处理UIAlertView点击。 当我有多个可能的UIAlertView时,它开始感到混乱和错误,并且必须区分处理程序中被点击的内容。 我真正想要的是创build一个实现UIAlertViewDelegate协议的对象,并在显示时将这个一次性对象赋予我的UIAlertView 。 我想要这样的东西: let confirmDelegate = UIAlertViewDelegate() { func alertView(alertView: UIAlertView!, clickedButtonAtIndex buttonIndex: Int) { // Handle the click for my alertView } } 然后在显示警报时使用它: let alertView = UIAlertView(title: "Confirm", message: "Are you sure?", delegate: confirmDelegate, cancelButtonTitle: "No", otherButtonTitles: "Yes") alertView.show() 这可能没有声明一个新的类? 我知道我可以做这样的事情: class ConfirmDelegate: UIAlertViewDelegate { func alertView(alertView: UIAlertView!, clickedButtonAtIndex buttonIndex: Int) […]

如何在ios设备中安装应用程序后显示一次警报

在设备上或模拟器上安装应用程序之后,如何在应用程序启动时仅显示一次警报,直到从设备上删除它。 有可能告诉我..