ChrisXu / CXAlertView

Custom alert-view which allow you to add view as main content.
MIT License
323 stars 81 forks source link

Issue getting only in iOS 9 above versions #46

Open vikramarkareddy opened 8 years ago

vikramarkareddy commented 8 years ago

I am entering some text in text field then after click on submit button (at that time key board is appeared).... after one alert view or custom alert will come.... But in ios 9 above versions popups(alert views, custom alerts) automatically disappeared

ChrisXu commented 8 years ago

Maybe it is caused by the windowLevel, it would be better for me to investigate if you could provide me some sample code. Thx!

@implementation CXAlertBackgroundWindow

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
        self.opaque = NO;
        self.windowLevel = UIWindowLevelAlert - 1; // This line
        self.rootViewController = [[CXTempViewController alloc] init];
        self.rootViewController.view.backgroundColor = [UIColor clearColor];
    }
    return self;
}