uialertview

iOS- How can I get UIAlertView width with customize and put the UILabel to center

家住魔仙堡 提交于 2019-12-11 04:46:02
问题 I was custom the UIAlertView , I need add some component to the alertView (like label, tableview). But I have a question. I need to know the alertView's width. I try to add self.frame.size.width , but I just got the 0.000000 . How can I get the alertView's width? I will calculate to put the subview at, and put the UILabel to subview to center. My partial code below: .h file: #import <UIKit/UIKit.h> @interface CustomTableViewAlert : UIAlertView -(instancetype)initWithTitle:(NSString *)title

UIAlertView in landscape mode does not display message [duplicate]

瘦欲@ 提交于 2019-12-11 04:22:51
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: UIAlertView not showing message text I am trying to create a simple UIAlertView for an app in landscape mode but all I see is the title and buttons but no actual message. It has something to do with the space available for the UIAlertView on the screen as if I remove a couple of the buttons then the message displays fine. Is there a way to force the UIAlertView to resize itself to fit? Relevant code is here

Time Picker in UIAlertView

谁说我不能喝 提交于 2019-12-11 01:53:37
问题 I'm in need of a popup that asks for a time input, I figured an alertview would be the way to go but I have no idea where to begin embedding a time picker into an alertview. Unless there is a better way of doing this? 回答1: For anybody else, I adapted the question in the comments to be a time picker like so: let vc = UIViewController() vc.preferredContentSize = CGSize(width: 250,height: 300) let pickerView = UIDatePicker(frame: CGRect(x: 0, y: 0, width: 250, height: 300)) vc.view.addSubview

Detect Internet Connection and display UIAlertview Swift 3

筅森魡賤 提交于 2019-12-11 01:23:44
问题 I am making an app that detects if there is a connection to internet by using if else statement, when there is internet, do nothing but if there are no internet connection, then alert view to say the app requires an internet I managed found Reachability but to implement on my viewDidLoad() the uialertview seems to be not working. I am using this: public class Reachability { class func isConnectedToNetwork() -> Bool { var zeroAddress = sockaddr_in(sin_len: 0, sin_family: 0, sin_port: 0, sin

adding ok button at run time in UIAlertview ios

我的未来我决定 提交于 2019-12-10 23:48:51
问题 I call alert with progress indicator view while calling web services.i am having an alert view set up like this: [self.activityIndicatorView setHidden:NO]; self.alertView = [[UIAlertView alloc] initWithTitle:@"Sending Login Request.." message:@"\n" delegate:self cancelButtonTitle:nil otherButtonTitles:nil]; self.activityIndicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; self.activityIndicatorView.center = CGPointMake(139.5,

Localizing system generated privacy alert message iOS UIAlertView Xcode

眉间皱痕 提交于 2019-12-10 18:07:21
问题 I have an app in development using Xcode Swift 1.1 and am testing it using iOS 7.1 and iOS 8.1 simulators. The app allows users to access their photos library, but before they can, iOS displays the Privacy alert message title asking for the user's permission in English language - “ App Name ” Would Like to Access Your Photos. (Side note: the alert is triggered when calling PHAsset and/or ALAssetsLibrary.) My app will be available in a few different languages, for example, Chinese. However

UIActivityIndicatorView not displaying in UIAlertView - iOS7 [duplicate]

可紊 提交于 2019-12-10 16:37:32
问题 This question already has answers here : Alert view is showing white rectangle in iOS7 (3 answers) Closed 6 years ago . I need to UIActivityIndicatorView in UIAlertView when loading. But UIActivityIndicatorView is not displaying when I add this with UIActivityIndicatorView not displaying in UIAlertView - iOS7 in iOS 7 . And this is working good in iOS 6 & lowest versions. Below is my code. Is there any solution ? . thanks. UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:nil message

iOS5: Has somebody managed to fix UIAlertView with three buttons and textfield (UIAlertViewStylePlainTextInput)?

♀尐吖头ヾ 提交于 2019-12-10 15:59:41
问题 Apple really screwed this one up. I want to use a UIAlertView with the new UIAlertViewStylePlainTextInput style and have three buttons in it. The result looks as follows: Has somebody managed to build a workaround until Apple will have fixed this issue? Maybe reducing the button height somehow or increase the total height of the alert view? 回答1: This is not a complete solution but it may get you started. UIAlertView view = new UIAlertView ("Alert", "This is an alert\n\n\n", null, "Login",

iOS Dev: Segue by pressing a button in an Alert?

十年热恋 提交于 2019-12-10 11:50:06
问题 I've been searching for a few hours and haven't found any answers, so I would really appreciate your help! I am designing an app and need to segue to a different view controller when a button in an alert is pressed. I already have the alert set up, but just need the code to segue to a new view. 回答1: Try this. create alertview first. UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:@"Message" message:@"Open New controller?" delegate:self cancelButtonTitle:@"No" otherButtonTitles:@

How do i display UIAlertController from any NSObject subclass?

喜欢而已 提交于 2019-12-10 10:35:56
问题 I have a legacy codebase I am managing, which needs to display alert messages from all over the place. This is terrible practice and is in need of a refactor, but that isn't going to happen any time soon. With iOS 9 I need the ability to fire & forget an alert view, and have the view display and queuing managed for me. 回答1: To show, UIAlertController , we need object of UIViewController So you can use below way to do that. UIWindow *keyWindow = [[UIApplication sharedApplication]keyWindow];