uialertview

Adding Activity Indicator to UIAlertView

廉价感情. 提交于 2019-12-03 03:02:37
I'm trying to add UIActivityIndicatorView to UIAlertView but couldn't get it done. I have seen posts on this implementation and found out that it works only for versions below iOS7. Below is the code I've tried... var alert: UIAlertView = UIAlertView(title: "Title", message: "Please wait...", delegate: nil, cancelButtonTitle: "Cancel"); var loadingIndicator: UIActivityIndicatorView = UIActivityIndicatorView(frame: CGRectMake(0.0, 0.0, 10.0, 10.0)) as UIActivityIndicatorView loadingIndicator.center = self.view.center; loadingIndicator.hidesWhenStopped = true loadingIndicator

How to customize UIAlertView? Will Apple approve it?

匿名 (未验证) 提交于 2019-12-03 02:49:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using a custom UIAlertView with UITextField to get password from the user. I have been told that this custom view may cause my App to get reject by Apple; is that correct? If so, what is the appropriate replacement for my custom control? 回答1: You can add a textfield to your UIAlertView UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"title" message:@"msg" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:nil]; UITextField *txtField = [[UITextField alloc] initWithFrame:CGRectMake(12.0, 45.0, 260.0, 25.0)];

how to add checkbox into uialertview?

匿名 (未验证) 提交于 2019-12-03 02:33:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm new in iPhone development. I want to add a check box into an alert view. I'm doing tests on this alertview for the last two days, but do not get any working demo project. I want exactly this alertbox! Can anyone help me? 回答1: try this code for add checkbox in alertview . UIButton *nameField = [[UIButton alloc] initWithFrame:CGRectMake(0.0, 0, 50, 50.0)]; UIView *v = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 250, 40)]; [nameField setImage:[UIImage imageNamed:@"checkbox_off.png"] forState:UIControlStateNormal]; [v addSubview:nameField

UIAlertView Vs UIAlertController - no keyboard in iOS 8

匿名 (未验证) 提交于 2019-12-03 01:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a old Xcode project that is targeted for iOS 6 and higher. I recently opened it up in Xcode 6 and ran in iPhone 6 simulator for iOS 8. When I tried this action UIAlertView* dialog = [[UIAlertView alloc] initWithTitle:@"Enter Folder Name" message:@"Keep it short and sweet" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil]; dialog.alertViewStyle = UIAlertViewStylePlainTextInput; dialog.tag = 400; [dialog show]; I get a pop-up window but when I click on the text field, no keyboard comes up. I googled and read that I

Is it possible to lay out 2 buttons vertically on UIAlertView?

匿名 (未验证) 提交于 2019-12-03 01:47:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to create UIAlertView with two buttons. I need to lay out these buttons vertically (my text is too big). Is it possible ? Screen1 Screen2 回答1: It's not possible by default. The appearance shown in nycynik's answer is what happens when you have more than two buttons. So, either add another button, or you could look into a third-party solution such as this library , although I have not tested it. 回答2: There seems to be no SDK support for this behavior. Two buttons in a UIAlertView will always be shown in a horizontal layout. However, it

UIAlertView like “Turn On Location Services to allow maps to determine your location”. Settings + Cancel

匿名 (未验证) 提交于 2019-12-03 01:25:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I Want to emit this alert: Turn On Location Services to allow maps to determine your location I need both "Settings" and "Cancel" exactly like the "maps" application. "Settings" should open settings->general->location services I didn't find the way to open the settings page. Can you help me? Thanks 回答1: Creating the alert is pretty straightforward, it's just a (faux-)modal UIView. However, it's not possible to open the Settings app programmatically, at least not without using private methods that will prevent your app from being approved for

UIAlertView addSubview in iOS7

匿名 (未验证) 提交于 2019-12-03 01:07:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Adding some controls to UIAlertView was deprecated in iOS7 using addSubview method. As I know Apple promised to add contentView property. iOS 7 is released now and I see that this property is not added. That is why I search for some custom solution with ability to add progress bar to this alertView. Something for example similar to TSAlertView , but more ready for using in iOS 7 . 回答1: Here is a project on Github to add any UIView to an UIAlertView-looking dialog on iOS7. (Copied from this StackOverflow thread .) 回答2: It took me only 1 day

After iOS 8, can I continue to use UIActionSheet and UIAlertView?

匿名 (未验证) 提交于 2019-12-03 00:47:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have apps which use UIActionSheet and UIAlertView . In iOS8, Apple's documentation and some websites say that they are deprecated in iOS8. UIActionSheet documentation Important: UIActionSheet is deprecated in iOS 8. (Note that UIActionSheetDelegate is also deprecated.) To create and manage action sheets in iOS 8 and later, instead use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet. But in Xcode 6 with deployment target 8.0 does not generate warning for the use of UIActionSheet and UIAlertView . Normally Xcode

Add image to alert view

筅森魡賤 提交于 2019-12-03 00:46:34
I have an alert view that pops up when the user press the add button. How do i add an image to the alert view? I added some code that i took reference from stack overflow. My save button is replaced with the image and the image appear to be in blue colour... Code for Alert View var alert = UIAlertController(title: "Spring Element \(springNumber)", message: "Add spring properties", preferredStyle: .Alert) let saveAction = UIAlertAction(title: "Save", style: .Default) { (action: UIAlertAction!) -> Void in let textField1 = alert.textFields![0] as UITextField self.txtField1.append(textField1.text)

How to customize UIAlertView? Will Apple approve it?

我们两清 提交于 2019-12-03 00:32:10
I am using a custom UIAlertView with UITextField to get password from the user. I have been told that this custom view may cause my App to get reject by Apple; is that correct? If so, what is the appropriate replacement for my custom control? You can add a textfield to your UIAlertView UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"title" message:@"msg" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:nil]; UITextField *txtField = [[UITextField alloc] initWithFrame:CGRectMake(12.0, 45.0, 260.0, 25.0)]; [alertView addSubview:txtField]; [alertView show]; [alertView