iAd works in iPhone but not iPad

2019-07-16 02:24发布

问题:

I have just uploaded my first app to the app store that was only designed for iPhone/iPod. It works, and the iAd functions work when it runs on a iPhone or iPod, but when it's run on an iPad, and it can be zoomed in and things, the iAd banners aren't loading. No errors are generated, but the ad banners don't load.

Does anyone have any ideas? I tried changing the app to universal and then it works, but the layout changes. Is there a way for the iAds to work on a zoomed-in iPad version, or is it just because the app has only just been released?

Thanks.
J

回答1:

That is the way it is supposed to be. If your app does not have an iPad version, and users just run it zoom in on iPad then iAds will not show up. The only way you are going to have iAds show up is to create a universal app with two storyboards or nibs. One for each device. That's what I ended up doing, so all users will receive iAds and not be able to bypass them.



回答2:

I've made it work by making it a Universal app, and checking the idiom flag and doubling any values that require a position or font size. You may need to scale any sprite sizes as well.

if ((UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad))
{
    _accDescLabel.fontSize = 40;
    _accDescLabel.position = CGPointMake(self.size.width/2 + 100, self.size.height - 260);
}
else
{
    _accDescLabel.fontSize = 20;
    _accDescLabel.position = CGPointMake(self.size.width/2 + 50, self.size.height - 130);
}


标签: xcode iad