uialertcontroller

Change Action sheet popover arrow in iOS8

試著忘記壹切 提交于 2019-12-20 17:26:33
问题 i'm using UIAlertController . But on iPad with iOS 8, actionSheet show with popover arrow. Any ideas to hide that arrow? Here is my code: UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"this is alert controller" message:@"yeah" preferredStyle:UIAlertControllerStyleActionSheet]; UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel action") style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) { NSLog(@

UIAlertController showing with delay

依然范特西╮ 提交于 2019-12-20 09:26:40
问题 I'm experiencing a problem with UIAlertController on my app now migrated to iOS8 with Date Picker inside. Below is the code. UIAlertController *AlertView = [UIAlertController alertControllerWithTitle:title message:nil preferredStyle:UIAlertControllerStyleActionSheet]; UIAlertAction *ok = [UIAlertAction actionWithTitle:@"Ok" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { [AlertView dismissViewControllerAnimated:YES completion:nil]; }]; UIAlertAction *set = [UIAlertAction

Should self be captured as strong in a UIAlertAction's handler?

瘦欲@ 提交于 2019-12-20 08:44:50
问题 When writing the handler closure of a UIAlertAction , should the reference to self be strong (the default), weak , or unowned ? There have been posts relevant to this topic (1, 2, 3, 4) but I honestly don't see how they help in this case. Let's focus on this typical code: func tappedQuitButton() { let alert = UIAlertController(title: "Confirm quit", message: nil, preferredStyle: .ActionSheet) let quitAction = UIAlertAction(title: "Quit", style: .Default) { (action) in self

How to put an image on UIActionSheet?

坚强是说给别人听的谎言 提交于 2019-12-20 07:54:58
问题 How to put image on UIActionSheet on right position of text. Like given in apple music player. Note: Don't answer with custom view, if it is possible in UIActionSheet , Kindly let us know. 回答1: Don't answer with custom view Then you are effectively forbidding anyone to answer, because that is what you do . First of all, there is no such thing as UIActionSheet. It was deprecated four years ago. Today we use UIAlertController. UIAlertController is nothing but a prepackaged presented view

Need help setting up an interface where rotation is fixed for most elements, but alert and sharing boxes auto-rotate with the device

≯℡__Kan透↙ 提交于 2019-12-20 03:31:38
问题 I'm working with Xcode 7 and Swift 2. I am working on an interface with a camera preview layer and controls that display in a manner similar to the native iOS camera app. The controls all stay in place as you turn the device, but the icons "pivot" in place to orient properly for the device orientation. (I hope I explained that in a way that makes sense. If not, open the native camera app on your iPhone and turn the device around a few times to see what I'm talking about.) I have the basic

How to present UIAlertController from SKScene

廉价感情. 提交于 2019-12-20 03:14:51
问题 I'm working in Spritekit and I'm trying to present a UIAlertController from my SKScene, but I am having trouble doing it. I've watched several tutorials but none of the UIAlertController tutorials have been specific to Spritekit. I keep seeing this code below, but it has not been effective since SKScene is not a UIViewController. [self presentViewController:self animated:YES completion:nil]; I have the rest of the relative code below. Can anybody please help me present my UIAlerController on

UIAlertController subclass issue swift

╄→гoц情女王★ 提交于 2019-12-19 09:07:05
问题 I want to create a UIAlertController's subclass but I'm going crazy because I have problem with constructor, this is my subclass: class loginAlert : UIAlertController { required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) } } I think that this subclass must have the constructor : UIAlertController(title: String, message: String, preferredStyle: UIAlertControllerStyle) , because it's a subclass of UIAlertController , but when I do loginAlert(title: "test", message: "test",

Is it possible to customize the font and appearance of a UIAlertController in the new XCode w/ iOS8?

一曲冷凌霜 提交于 2019-12-19 04:47:17
问题 I'm wondering if it's possible to customize in app alerts with the UIAlertController. I haven't seen anything that explicitly says that you can. Does anyone know of a way I can add a custom appearance, particularly with fonts on these alerts? 回答1: You can do it with appearanceWhenContainedIn. To set up background color, here's an example: [[UIView appearanceWhenContainedIn:UIAlertController.class, nil] setBackgroundColor:[UIColor yellowColor]]; Or tint color: [[UIView

Add UITextView on UIAlertView (iOS, Xamarin) without using any third party lib

我怕爱的太早我们不能终老 提交于 2019-12-19 04:46:20
问题 I want to display a dialog in iOS and add a UITextView to the view of the dialog. The UITextView textView has text with clickable links for email,phone and url. I am able to trigger the dialog but only with the title and an ok button. There is no textview being added to the dialog view. I am not sure if the issue here is with the textview or with the way the view is being added to the dialog. Please check my code below: UITextView textView = new UITextView(); textView.Editable = false;

create alert function in all view controllers - swift

半城伤御伤魂 提交于 2019-12-19 04:23:32
问题 I'm trying to declare a function for showing alerts in my app. To avoid repeating work, i'm trying to use same function for all my app. I tried to do that by creating a class with function showNotification. but when i create an object of that class and call the method, nothing happens. How can i do that? class SharedPropertiesAndMetods : UIViewController { func showNotification(title: String, message: String) { let alertController = UIAlertController(title: title, message: message,