我在admob橫幅的屏幕底部留出了大約100個高度(不知道單位)的高度,這將在項目結束時添加。我應該爲底部Admob橫幅留出多少空間?
爲iPhone 6,AdMob廣告橫幅的高度約爲100
但是,當我移動到ipad,這個高度是不同的。
所以一些元素的位置不同(高度方向)。
例如:
float admobHeight = 100.0;
Vec2 desiredPosition = Vec2(0, 100);
auto sprite = Sprite::create("image.png");
sprite->setAnchorPoint(Vec2(0, 0));
// Leave out space for the bottom Admob banner.
sprite->setPosition(Vec2(desiredPosition.x, desiredPosition.y + admobHeight));
this->addChild(sprite);
我設置DesignResolution爲:
(AppDelegate.cpp)
static cocos2d::Size designResolutionSize = cocos2d::Size(768, 1136);
和解決政策NO_BORDER:
glview->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, ResolutionPolicy::NO_BORDER);
我怎麼能離開了高度的空間恰到好處量在我的屏幕底部爲Admob提供各種類型的設備?
https://developers.google.com/android/reference/com/google/android/gms/ads/AdSize –
http://stackoverflow.com/questions/21846346/admob-with-cocos2d- V3/21859218#21859218 – Guru