Subview shifting down 20 pixels when called in App

2019-07-14 02:05发布

问题:

I'm facing this issue when I'm calling AdMob ad with

[rootController.view addSubview:adMobAd]; //setup the ad

Upon returning from the ad being clicked the AdMob frame moves down 20 pixels. However it seems that this is not a AdMob issue, but a issue that is also discussed here: https://discussions.apple.com/thread/2288486

However I couldn't get it to work, any ideas?

回答1:

20 pixels is the height of the status bar. If the app will don't use the status bar make sure all the XIB files you are using has the status bar turned off. You may also include in the Info.plist the UIStatusBarHidden property and set it to YES.