uialertcontroller

Change UIActionSheet buttons background color and button font

允我心安 提交于 2020-01-06 19:29:06
问题 I have a UIActionSheet in my application. I want to change the background color of actionsheet buttons and the font of the buttons. I made a search found below code: for (UIView *_currentView in actionSheet.subviews) { if ([_currentView isKindOfClass:[UIButton class]]) { //DO YOUR WORK } } but this code is not working on ios 8. for ios I found below code too: [[UIView appearanceWhenContainedIn:[UIAlertController class], nil] setTintColor:[UIColor redColor]]; but this code only changes the

Cannot detect device as iPad

你。 提交于 2020-01-06 13:52:50
问题 I'm making an app that uses HealthKit. The app must not work on an iPad, and as such my viewDidLoad method contains an if/then/else statement to show an alert to iPad users. This is my code: if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone && SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0") && [HKHealthStore isHealthDataAvailable] == 1) { ... } else { UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Whoops!" message:@"Looks like

Cannot detect device as iPad

只谈情不闲聊 提交于 2020-01-06 13:52:38
问题 I'm making an app that uses HealthKit. The app must not work on an iPad, and as such my viewDidLoad method contains an if/then/else statement to show an alert to iPad users. This is my code: if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone && SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0") && [HKHealthStore isHealthDataAvailable] == 1) { ... } else { UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Whoops!" message:@"Looks like

Add an animation image per image inside a UIAlertController SWIFT

a 夏天 提交于 2020-01-05 08:47:30
问题 I have a function to display an UIAlertController. Below the title and the text, I would like to display an animation image per image. I have 13 images to loop. func alertDownloadInProgress(text:String, sender:UIViewController) -> UIAlertController { var alert = UIAlertController(title: "Alert", message: text, preferredStyle: UIAlertControllerStyle.Alert) sender.presentViewController(alert, animated: true, completion: nil) return alert } Is it possible to use an UIAlertController or I have to

UIAlertController code runs, but doesn't present an alert

China☆狼群 提交于 2020-01-05 07:28:07
问题 I am trying to make an in-app popup alert using swift and I have run into an error that I know nothing about. Here is the code I use to present my alert: let welcomeAlert = UIAlertController(title: "Welcome!", message: “message here”, preferredStyle: UIAlertControllerStyle.Alert) welcomeAlert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: nil)) self.presentViewController(welcomeAlert, animated: true, completion: nil) println("welcome alert displayed!") The

iOS 13 UIAlertController - Color change in attributedMessage and attributedTitle doesn't work

China☆狼群 提交于 2020-01-05 06:44:28
问题 Color change in attributedMessage and attributedTitle doesn't work. Is there a solution for it? Works well on iOS 12 but no longer works on iOS 13. What can be done or is there a solution or a modification? Here's the full snippet: NSString *title=NSLocalizedString(@"Title",nil); NSString *message=NSLocalizedString(@"Message",nil); UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleActionSheet];

iOS 13 UIAlertController - Color change in attributedMessage and attributedTitle doesn't work

时光总嘲笑我的痴心妄想 提交于 2020-01-05 06:44:05
问题 Color change in attributedMessage and attributedTitle doesn't work. Is there a solution for it? Works well on iOS 12 but no longer works on iOS 13. What can be done or is there a solution or a modification? Here's the full snippet: NSString *title=NSLocalizedString(@"Title",nil); NSString *message=NSLocalizedString(@"Message",nil); UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleActionSheet];

Spinner alert Ionic

一世执手 提交于 2020-01-03 15:38:08
问题 I want show an alert with a spinner in subTitle like: I tryed, without success: this.alertCtrl.create({ title: 'Verificando', subTitle: '<ion-spinner name="dots"></ion-spinner> foo bar' }); Any ideas ? 回答1: Unfortunately AlertController from Ionic 2 doesn't offer a way by default to embed HTML code inside the title/subtitle attribute. Will this alert be used only when you are loading something? On that case I suggest that you use the LoadingController component, with LoadingController it's

UIAlertController dismiss is slow

妖精的绣舞 提交于 2020-01-02 07:33:52
问题 After iOS 8, changing my implementation to UIAlertController instead of UIAlertView is giving me some headaches. The dismissal takes around a full second before the UI becomes responsive after clicking a button. It means users think there's something wrong. Am I the only one suffering from this? It's across several apps, and true for an implementation as simple as this. I tried this in a new blank project. - (IBAction)showAlertView { [[[UIAlertView alloc] initWithTitle:@"test" message:@"test"

alertController with white borders

纵然是瞬间 提交于 2020-01-02 06:47:10
问题 I have created an alertcontroller with action sheet and two buttons. As the actionsheet will be having rounded edges, on the screen, on four corners, white color is appearing. I tried changing the background color of the alertcontroller, but that is making the action sheet to rectangular with sharp border instead of rounded borders. I tried setting the view background color to clear color Tried setting the border radius too. Here is my action sheet. I want those white edges invisible. Also,