uialertview

UIAlertViewStyleLoginAndPasswordInput with more TextFields?

点点圈 提交于 2019-12-12 04:59:05
问题 Its possible add more TextFields to UIAlertViewStyleLoginAndPasswordInput? How could i do? Or there is other possibility? 回答1: Yes this is possible you can do it like this UIAlertView *myAlertView = [[UIAlertView alloc] initWithTitle:@"Your title here!" message:@"this gets covered" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil]; UITextField *myTextField = [[UITextField alloc] initWithFrame:CGRectMake(12.0, 45.0, 260.0, 25.0)]; [myTextField setBackgroundColor:[UIColor

Display alert from a non-UI class

ぐ巨炮叔叔 提交于 2019-12-12 04:44:35
问题 I'm using Alamofire in my application and wish to display an alert if the request has an error (e.g. wrong URL), etc. I have this function in a separate class as it is shared among the pages of the application. Alamofire.request(.GET, api_url) .authenticate(user: str_api_username, password: str_api_password) .validate(statusCode: 200..<300) .response { (request, response, data, error) in if (error != nil) { let alertController = UIAlertController(title: "Server Alert", message: "Could not

Xcode show UIAlertView after UITableRowSelection?

旧时模样 提交于 2019-12-12 04:36:11
问题 this is my first question, sorry if something is wrong Well I'm trying to create a view in which i can select a friend from a table view and then it should say the number and the mail on a UIAlertView but I dont know how to do this the friend list is obtained from an xml file on my site, and then is parsed an showed on a table with a custom cell design this is the code that creates each cell - (UITableViewCell *)tableView:(UITableView *)myTableView cellForRowAtIndexPath:(NSIndexPath *

Disable Alert Button when Text Field is Null with Swift 3

空扰寡人 提交于 2019-12-12 04:19:50
问题 I would like to disable the alert button when the text box is null. I put the button in Table View Cell. So, when you click that button, the alert box will pop up. My codes are below. func cellTapped(cell: DeviceListTableCell) { self.showAlertForRow(row: tableView.indexPath(for: cell)!.row) } func showAlertForRow(row: Int) { let alert = UIAlertController( title: "Enter Password !!!!!", message: "", preferredStyle: .alert) alert.addTextField { (textField) in } let okAction = UIAlertAction

IBAction within UIAlertView xcode 4.3

被刻印的时光 ゝ 提交于 2019-12-12 02:53:28
问题 I have a counter in my app that has a reset button, but instead of resetting immediately after tapped, I want a UIAlertView to popup and have the user tap Reset again as a button in the alert. I'm not entirely well experienced in this so I would ask that your answer just simply add/replace parts of my code below. I'm working on this lol. Thanks for any help! - (IBAction)reset { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"titleHere" message:@"messageHere" delegate: self

UIAlertview exc_bad_access [duplicate]

和自甴很熟 提交于 2019-12-12 02:49:12
问题 This question already has answers here : UIAlertView fails to show and results in “EXC_BAD_ACCESS” error (6 answers) Closed 5 years ago . I add a function to dismiss the UIAlertView after several seconds.The whole code is like: - (void)netWorkAlert { UIAlertView *netWork = [[UIAlertView alloc] initWithTitle:@"error" message:@"network has problems" delegate:self cancelButtonTitle:nil otherButtonTitles: nil]; [netWork show]; [self performSelector:@selector(dismissAlert:) withObject:netWork

iOS 6.0- UIAlertView failed to addSubview. Works fine in lower version

感情迁移 提交于 2019-12-12 02:32:14
问题 This is my code to show the table view inside alert view. Its working perfectly in iOS 5.1. But in iOS 6.0 it doesnt show the table view inside alert view. UIAlertTableView.h #import <UIKit/UIKit.h> @class UIAlertView; @interface UIAlertTableView : UIAlertView { // The Alert View to decorate UIAlertView *alertView; // The Table View to display UITableView *tableView; // Height of the table int tableHeight; // Space the Table requires (incl. padding) int tableExtHeight; id

UIAlertView with text fields not moving up

感情迁移 提交于 2019-12-12 01:56:36
问题 I want to display a prompt to get a user's username and password. I am doing this by displaying a UIAlertView and adding UITextFields as subviews to it. Recently I moved my project over to XCode 4.2 and I updated all my project settings. My base SDK is set to iOS 5.0 and my deployment target is set to 4.0. I then noticed that it was only being built for armv7 architectures and so I changed that to include armv6 as well since I would like to support the iPhone 3G as well. After doing this I

UIAlertView text formatting

廉价感情. 提交于 2019-12-12 01:39:58
问题 Hi I was wondering if it is possible to change the text formatting of the uialertview. i.e The message "You have won" but with the "won" word in bold. I looked around and it seems that the only solution is for me to create my own popup. any ideas? Thanks 回答1: This isn't possible at present. You'd have to create a custom UIAlertView . That's the only option as it is not to be subclassed. From the Class Reference: Subclassing Notes The UIAlertView class is intended to be used as-is and does not

Showing UIActionSheet over UIAlertView

守給你的承諾、 提交于 2019-12-12 00:27:53
问题 For a specific server notification I am supposed to show an UIActionSheet. But problem here is when that event comes, at the same time if any UIAlertView already showing on any view controller, it make the UIActionSheet disabled( After pressed ok for alert view I am not able to select anything on view controller , view got disabled because of UIActionSheet). Anyone faced this kind of problem, Any idea how to solve it? I have tried by dismissing alert view before showing action sheet, however