草庐IT

UiAlertView

全部标签

ios - 使用 swizzling 更改 UIAlertView

我最近收到了一个私有(private)硬件SDK,可以集成到我公司的移动应用程序中。一切都很好,除了他们使用的是UIAlertView作为一些不透明方法调用的结果,我的设计团队想要标记它。我无权访问SDK的源代码。有什么方法可以让我安全地混合UIAlertView保留所有功能并简单地修改UIAlertView的外观所以它更具品牌/与应用程序外观一致?如果是这样,我会重载drawRect或其他东西,我如何找出UIAlertView中标签的名称?以便我可以用我想要的大小、形状和颜色绘制它们?有关更多详细信息,该应用目前不使用UIAlertView或UIAlertViewController

ios - 将 UIImage 添加到 UIAlertView 未按预期工作

我正在开发一个应用程序。我尝试使用以下代码将UIIMage添加到UIAlertView,UIAlertView*alert=[[UIAlertViewalloc]initWithTitle:@"Instruction"message:@"PleaseTAPonScreentoContinue."delegate:selfcancelButtonTitle:@"OK"otherButtonTitles:nil];UIImageView*imageView=[[UIImageViewalloc]initWithFrame:CGRectMake(220,50,32,32)];UIImage*

c# - Xamarin 警报失败

当我调用UIAlertView时出现错误:/Users/sun/Projects/csharp/csharp/ViewController.cs(13,13):WarningCS0618:'UIAlertView.UIAlertView(string,string,UIAlertViewDelegate,string,paramsstring[])'isobsolete:'UseoverloadwithaIUIAlertViewDelegateparameter'(CS0618)(csharp)代码:voidHandleTouchUpInside(objectsender,EventA

objective-c - UIAlertView clickedButtonAtIndex 未被调用

这就是我创建警报的方式:UIAlertView*dialog=[[UIAlertViewalloc]init];dialog.delegate=self;//someoptionsaField=[[UITextFieldalloc]initWithFrame:CGRectMake(20.0,45.0,245.0,25.0)];[aFieldsetBackgroundColor:[UIColorwhiteColor]];[dialogaddSubview:appkeyField];[dialogshow];[aFieldrelease];但是-(void)alertView:(UIAle

ios - 我可以在 Xcode 中为一个 IBAction 设置多个 UIAlertViews 吗?

是否可以在Xcode中为一个IBAction编写多个UIAlertView以随机显示。例如:我正在制作一个随机显示多个​​问题的应用程序,当按下提交按钮时,会显示一条警告,说明答案是否正确。我希望警报有不同的消息,例如一次它显示一条消息,然后下一次它随机显示另一条消息。我该如何编程? 最佳答案 在你的.h中:@interfaceMyViewController:UIViewController{NSArray*messages;}@property(nonatomic,retain)NSArray*messages;在你的.m@im

ios - 更改 UIAlertView 中按钮的可访问性标签 - iOS

我正在尝试更改UIAlertView按钮上的辅助功能标签。我在网上看到这段代码:UIAlertView*alert=[[UIAlertViewalloc]initWithTitle:@"Test"message:@"Message"delegate:nilcancelButtonTitle:@"Ok"otherButtonTitles:nil];//InastandardUIAlertViewthereare2UILabelsandsomebuttons//TheUILabelwiththemessageisalwaysthe2ndobjectinthearrayNSArray*sub

iOS 7 禁用像 UIAlertView 这样的用户交互

在iOS7中,UIAlertView弹出时,导航栏按钮的TintColor变为灰色,不难处理。(类似于随附的屏幕截图)。没有UIAlertView有什么方法可以实现这些行为吗? 最佳答案 要禁用按钮,例如导航栏上的按钮,您可以使用按钮的“enabled”属性:self.cancelButton.enabled=NO;或[self.cancelButtonsetEnabled:NO];您的按钮将是灰色的,并且没有可能的互动。 关于iOS7禁用像UIAlertView这样的用户交互,我们在S

ios - 设置 UIAlertView 委托(delegate)

我尝试调用委托(delegate)方法,但没有调用。我应该在我的代码中更改什么?谢谢。我尝试在Class1.m中添加:+(void)popupAlert:(NSString*)msgtag:(NSInteger)tag{Class1*c=[[Class1alloc]init];UIAlertView*alert=[[UIAlertViewalloc]initWithTitle:@""message:msgdelegate:c(Ialsotriedc.self)cancelButtonTitle:...otherButtonTitles:...,nil];alert.tag=tag;[a

IOS NSString 解码不工作

我从互联网上收到一个字符串,但我找不到一种方法来转换特殊字符,它们显示在警告框中。这是字符串:@"Sorry,yoursearchdoesn\u0027thaveanyresult"我知道我可以做这样的事情来解决[responsestringByReplacingOccurrencesOfString:@"\u0027"withString:@"'"];但我想要一个适用于任何角色的解决方案我已经尝试了几种解决方案,但都没有接缝工作,我不知道为什么 最佳答案 你可以这样做:NSString*escapedStr=@"Sorry,you

ios - 如果应用程序不在 iOS 的前台或后台,您如何显示推送通知的警报 View ?

如果应用程序在后台或前台,我知道如何使用以下代码显示推送通知UIAlertView:(void)application:(UIApplication*)applicationdidReceiveRemoteNotification:(NSDictionary*)userInfo{NSString*message=[[userInfoobjectForKey:@"aps"]objectForKey:@"alert"];UIAlertView*alert=[[UIAlertViewalloc]initWithTitle:@""message:messagedelegate:nilcance