0

I have a UIAlertView that's appearing and blocking input, but the actual "OK/Cancel" is 0×0 at (0, 0), so it's not dismissible by the user. Below is my current fix, but I'd much rather be able to tell iOS "Hey! This isn't right. Make it right." So, is there any way for me to reposition or reset the position of a UIAlertView's frame in iOS?

if (_floatingAlert &&                                                        // if there is an alert AND...
    (_floatingAlert.visible ||                                               // ( the alert isn't visible OR...
     _floatingAlert.frame.size.height + _floatingAlert.frame.size.width == 0)//  The frame is invisibly small )
    )
{
    [_floatingAlert dismissWithClickedButtonIndex:0 animated:YES];
    _floatingAlert = nil;
}
Ky -
  • 30,724
  • 51
  • 192
  • 308
  • 1
    i highly doubt the alertview is wrong by itself, did you somehow change it by adding custom buttons or views? you are not allowed to do that. – luk2302 Mar 27 '15 at 17:42
  • basically you just show and MAYBE dismiss it by yourself, but in general, you should not need or even must not add any more code regarding display – luk2302 Mar 27 '15 at 17:45
  • We are not modifying it, no. All we do is `alloc` and `init` it and `show` it. – Ky - Mar 27 '15 at 18:47
  • 2
    you are definitely doing something... fishy... – luk2302 Mar 27 '15 at 19:03

1 Answers1

1

Uialertview and uiactionsheet are depreciated and though they still work for now you should consider using uialertcontroller.

I am currently working on a project where I came across a couple comments about what you are looking to do. One option would be to set your class as a uialertcontroller delegate which sounded like gave some control over customizing appearance. The other option would be to create your own view that you customize and present it to a user when you need to alert the user of something.

jimrice
  • 452
  • 5
  • 17
  • Thanks! We're not modifying it in any fancy way, so we'll look into replacing our uses of `UIAlertView` with uses of `UIAlertController`. – Ky - Mar 27 '15 at 18:46