uialertview

Changing the background color of a UIAlertView?

╄→尐↘猪︶ㄣ 提交于 2019-11-26 07:58:37
问题 I want to change the background color of my UIAlertView, but this doesn\'t appear to have a color attribute. 回答1: Background of AlertView is an image And you can change this image UIAlertView *theAlert = [[[UIAlertView alloc] initWithTitle:@"Atention" message: @"YOUR MESSAGE HERE", nil) delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] autorelease]; [theAlert show]; UILabel *theTitle = [theAlert valueForKey:@"_titleLabel"]; [theTitle setTextColor:[UIColor redColor]]; UILabel

How to add subview inside UIAlertView for iOS 7?

懵懂的女人 提交于 2019-11-26 07:29:34
问题 I am having an application on iTunes store which displays some UILabel and UIWebView on UIAlertView . According to session video, addSubView for UIAlertView will not work. They have talked about ContentView . But in the GM Seeds SDK, I could not find that property and there seems to be no other way. The only thing I can do is to create a custom subclass of UIView and make it work like UIAertView . Can you suggest any other simple solution? Thanks for the help. 回答1: You can really change

UIAlertView first deprecated IOS 9

久未见 提交于 2019-11-26 07:07:07
问题 I have tried several ways to use UIAlertController,instead of UIAlertView. I tried several ways but I cannot make the alert action work. Here is my code that works fine in IOS 8 and IOS 9 but is showing up with deprecated flags. I tried the elegant suggestion below but I can\'t make it function in this context. I need to submit my app and this is the last thing to address. Thank You for any further suggestions. I am a newbie. #pragma mark - BUTTONS ================================ - (IBAction

Customizing UIAlertView

核能气质少年 提交于 2019-11-26 05:35:45
问题 Anyone have code to make this: (source: booleanmagic.com) or better yet, a 3x2 grid of buttons with images using the UIAlertView object? I don\'t care about the textfield, it\'s the buttons in a grid I want (preferably with images rather than text). 回答1: I think your best bet is to forget customizing UIAlert view and build a custom view yourself. For one, what you're showing really isn't an "alert" so it's counter to what UIAlertView is designed to be for. This means that you're changing the

Display UIViewController as Popup in iPhone

不问归期 提交于 2019-11-26 04:33:09
问题 Since there is no complete, definitive answer to this common recurring question, I\'ll ask and answer it here. Often we need to present a UIViewController such that it doesn\'t cover full screen, as in the picture below. Apple provides several similar UIViewController , such as UIAlertView , Twitter or Facebook share view controller, etc.. How can we achieve this effect for a custom controller? 回答1: NOTE : This solution is broken in iOS 8. I will post new solution ASAP. I am going to answer

UIAlertView addSubview in iOS7

假装没事ソ 提交于 2019-11-26 03:18:20
问题 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

How would I create a UIAlertView in Swift?

[亡魂溺海] 提交于 2019-11-26 01:38:31
问题 I have been working to create a UIAlertView in Swift, but for some reason I can\'t get the statement right because I\'m getting this error: Could not find an overload for \'init\' that accepts the supplied arguments Here is how I have it written: let button2Alert: UIAlertView = UIAlertView(title: \"Title\", message: \"message\", delegate: self, cancelButtonTitle: \"OK\", otherButtonTitles: nil) Then to call it I\'m using: button2Alert.show() As of right now it is crashing and I just can\'t

UIAlertController custom font, size, color

倖福魔咒の 提交于 2019-11-26 01:25:15
问题 I am using new UIAlertController for showing alerts. I have this code: // nil titles break alert interface on iOS 8.0, so we\'ll be using empty strings UIAlertController *alert = [UIAlertController alertControllerWithTitle: title == nil ? @\"\": title message: message preferredStyle: UIAlertControllerStyleAlert]; UIAlertAction *defaultAction = [UIAlertAction actionWithTitle: cancelButtonTitle style: UIAlertActionStyleCancel handler: nil]; [alert addAction: defaultAction]; UIViewController