Ok so I'm upgrading my iOS app to take advantage of the iPhone 6's larger display but iAd is still showing ads of the iPhone 5s dimensions (both on the banner and when you select the advert).
There's an annoying blank space either side of the banner, and a full frame of blank space around the view when the advert is selected.
My app has a correct iPhone 6 launch image and is showing native resolution (no scaling). Grateful if anyone can give me a pointer as to where I am going wrong.
The iAd frame is configured and sized with this code and placed at the bottom of the screen:
[_UIiAd setFrame:(CGRectMake(0, screenHeight - 100, screenWidth, 50))];
It looks like this:
It turns out that iAd is actually working fine, but Apple has not yet modified the dimensions of the test ad to suit the iPhone 6 and 6 Plus.
Update 25th Nov 2014 - Apple has now updated iAd banners to display the correct dimensions.
Related
I've recently updated Xcode to 7 so I could start developing against iOS 9. Upon first launching my application, I noticed that the screen size/scale is off compared to how it looks on iOS 8, both on the iPhone 6 device.
Here is how it looks correct on iOS 8:
Here is how it looks incorrect on iOS 9:
If you also notice, both of those images are the same exact size.
Note how the AdMob banner has white space on the left/right, I'm assuming AdMob just knows to center it. Also the big white space to the right of the table view and the button down on the bottom.
Also, when in iOS 8, and putting a break point in the main delegate method, the main window has a frame of (0 0; 320 568). The layer on the window is also the same.
On the flip side, when in iOS 9, and putting a break point in the main delegate method, the main window has a frame of (0 0; 375 667). The layer on the window is also the same.
That explains why the difference in the look of the app in iOS 8 vs. iOS 9, but I do not know why iOS 8 looks the way I want it to and iOS 9 doesn't. Is there some setting that I'm missing?
EDIT:
I've also since figured out that the bounds of the mainScreen is different between when this runs in iOS 8 vs. iOS 9. The screenBounds of the mainScreen is set to the same frame as up above, and I have no clue why it is different between the two iOS versions.
EDIT 2:
So I just created a brand new project and tested this out. I do not get the same behavior as explained up above in my first edit. When I view the mainScreen bounds, in both iOS 8 and iOS 9, it is (0,0;375,667);
I just cannot figure out what is causing this to happen so I can fix it.
EDIT 3:
After toying around quite a bit last night, it turns out that the launch images are causing this to happen. If I remove the launch images of Default-568#2x.png from the list, then it displays properly. Very odd that something like this can effect the scale. I still didn't figure out how to solve this yet though because you have to have launch images or apple will reject the app, so I'm keeping this open until I have more time tonight to toy around with it.
Are you testing on devices or simulators? If on device, your iOS 8 device might have Display Zoom enabled: Settings → Display & Brightness → Display Zoom. This would make an iPhone 6 (375 ✕ 667) think it’s an iPhone 5 (320 ✕ 568).
Apple has always looked at features of your application to decide what screen sizes your app can handle, and simulated a screen size that it is sure your app can cope with.
For example, you have probably added a launchscreen image in 320 x 568 pixels. That tells iOS that you know about 4" devices; without that your app would run in a 320 x 480 screen. To support an iPhone 6, you would have had to add a 375 x 667 launch screen; without it iOS reports that you have only an iPhone 5 sized screen.
Now you are using the iOS 9 SDK. When you use that SDK Apple expects you to handle any screen size, so suddenly it reports the true screen size of 375 x 667 (414 x 736 on a 6+). You can't use hardcoded sizes anymore; you have to adapt your app to the screen bounds.
I am working on an app and it has 3 storyboards - iPad, iPhone and iPhone 4. 3 different users (myself included) have had the experience where on their iPad - the splash screen that loads is small and in the top-left corner...leaving much white space to the right and bottom.
It is as if it is loading the iPhone size splash.
I have no launch screen file selected in the general tab of the project. I have also noticed that after restarting my iPad, it does seem to load the proper screen size. Any ideas as to what is going on?
Use this line of code for screen size.
CGRect screen_size = [[UIScreen mainScreen]bounds];
I have an app in Xcode 6.2 with the storyboard supporting all devices. For some reason, whenever I load the application on the iPhone 6+, or iPhone 4s, or iPad, the screen doesn't take the size of the iPhone/iPad. However, on an iPhone 6, 5s, and 5, the screen takes the full size of the iPhone. Why is this? I am very unfamiliar with sizes and how to properly support all sizes. Right now, I have set the screen sizes in the storyboard for each view controller to 320 x 568. The width is "Compact" and the height is "Any".
If this has anything to do with this, my iPad screen comes out blank. It's just white. Apple recently rejected my external testers app submission due to this.
I have done lots of research on these 2 questions, but I had a hard time understanding anything, as I am new to iOS Development.
To properly handle varying sizes and how that affects your layout you will want to use auto layout. Check out this great tutorial from ray wenderlich to get you started. Once you get started feel free to post more specific questions about any roadblocks you run into. Good luck!
http://www.raywenderlich.com/64392/video-tutorial-beginning-auto-layout
When you want your app to work on any device, ideally you should keep the width and height both set to "Any". You should switch to "Compact" or "Regular" width or height only if you have any requirement specific to a particular device. To understand things in detail read more on Size classes. It is very nicely documented in this Apple developer site.
iphone:
iphone 4- 320x480
iphone 5- 320x568
iphone 6- 375x667
iphone 6plus - 414x736
and also ipad:
ipad mini - 768x1024
ipad air - 768x1024
ipad pro 10.5 - 834x1112
ipad pro 12.9 - 1024x1336
iAd and AdMob's banner sizes only perfectly fit iPhone 4's and 5's. However, according to storyboards size, at least in terms of width, the perfect width size for iPhone 6 for a banner = 375. For iPhone 6+ perfect width for banner = 415. On Admob site for banner sizes, there is no supported width size 375 or 415. Even if I add Admob's Smartbanner code, it still doesn't have the 375, 415 sizes for the iPhone6, 6+ width. Same thing goes for iAd. What do i do then? Can I just make the custom size? I tested with test ads with these custom sizes and simulator and device work fine with them. However, will Apple accept this? Or is there another way to make ad banners fit full width size of phone?
I wish I could give you a definite answer as to what Apple would do, but I can tell you the iAds in my apps in the App Store work fine at multiple widths in the different iPhones.
A quick search gave me the following info about iAd banner sizes. But with retina devices such as the new iPad, is the height of an iAd double, ie. 132px?
"For iphone its height is 50 for potrait and 32 for landscape For ipad its height is 66 for potrait and 66 for landscape"
I'm fairly sure iAd banners are the same size in points on retina devices, meaning they will occupy the same space on the screen but with higher pixel density. This Apple documentation suggests this is true.
The iAd Banner use a real size of your display and not the resolution (this inside a xcode) if you use a iAd Producer is better make your banner ever strong and good resolution.
In fact the iAd Banner have not a resolution but use the real dimension of display for example:
iPhone5 portrait is 320x586, but the resolution of Retina is 640x1136px, the dimension of iAd in this case is 320x50 and is the same on any display Large 320, same happen on iPad.
if you want you can learn more on developer apple, here you can find the instruction and samples code: DeveloperApple iAd Guide
Hope this help you to understand :)