I am adding a view that fades in that gives my user alerts like successful login etc. Unfortunately the view does not appear above the keyboard so half of it gets hidden because I am displaying it in the center.
case 401:
alertBezel = [[MBProgressHUD alloc] initWithView:self.view];
[self.view addSubview:alertBezel];
// Make the customViews 37 by 37 pixels for best results (those are the bounds of the build-in progress indicators)
alertBezel.customView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"37x-Checkmark.png"]] autorelease];
alertBezel.mode = MBProgressHUDModeCustomView;
alertBezel.labelText = @"Unauthorized User!";
[alertBezel show:YES];
[alertBezel hide:YES afterDelay:1];
break;
I also tried getting the key window:
[[UIApplication sharedApplication] keyWindow]
No luck.
It sounds like you should really be using a UIAlertView. That will show up over the keyboard.
Below are some resources on customizing alert views:
how i can implement a custom UIAlertview with a progress bar and a cancel button?
http://www.skylarcantu.com/blog/2009/08/14/custom-uialertview-color-chooser/