項目中用到了彈窗類***,發現iOS 8.1正常,iOS 11彈窗不顯示,想到估計是window的問題,查了一下,果真有用。windows
出錯的位置: UIWindow * window = [[UIApplication sharedApplication].windows lastObject]; [window addSubview:self];
修改後: UIWindow * window = [UIApplication sharedApplication].keyWindow; [window addSubview:self];
還有其餘方式:code
[[UIApplication sharedApplication].windows firstObject]