I want to download a picture from the server and set it as fullscreen for the iphone4s, i use UIScreen *mainScreen = [UIScreen mainScreen];
and use this mainscreen to get the size (it's 960x640). When the app launches, I insert the code to AppDelegate .
if (im!=nil){
UIImageView *splashScreen = [[UIImageView alloc] initWithImage:im];
[self.window addSubview:splashScreen];
[UIView animateWithDuration:3 animations:^{splashScreen.alpha = 0.99;}
completion:(void (^)(BOOL)) ^{
[splashScreen removeFromSuperview];
}];
}
I noticed the size is incorrect, then I logged out the size of the self.window and found the size of the window is 320x480. How did this happen?
Here is how i get the sizes:
UIScreen *mainScreen = [UIScreen mainScreen];
UIScreenMode *ScreenMode = [mainScreen currentMode];
CGSize size = [ScreenMode size];
CGFloat screenWidth = size.width;
CGFloat screenHeight = size.height;