How to get Admob banner height via SonarFrameworks.h?

  • Sonared
    Likes 0

    Problem Description

    I’ve implemented Admob banner via Sonar Helper.

    and also,

    implemented Multi-device resolution support with the tutorial from Sonar: https://www.youtube.com/watch?v=C-MKlYLbn5Q.

     

    But I realize that the admob height appears differently in iPhone6 and 4.

    While the height is 100 in iphone6, it takes up more than that in iphone4 (the banner size itself is the same)

     

    Would there be any way to detect the banner height for different screen resolutions?

    (cf) 100 in height appears differnt in iPhone6 and 4 according to https://www.youtube.com/watch?v=C-MKlYLbn5Q.

     

     

     

  • Sonar Systems admin
    Likes 0

    What do you need the height for?


    This reply has been verified.
  • Sonared
    Likes 0

    I want to place something right above the banner.

    For iPhone5 and 6, the banner height is 100. But in iPhone4, it’s about 120.

    So I did:

        Vec2 origion = Director::getInstance()->getVisibleOrigin();

        sprite->setPosition(Vec2(0 + origin.x, 100 + origin.y));

    , but 100 appears in different scale between devices.

     

     

    screen resolution policy is in AppDelegate.cpp:

    static cocos2d::Size designResolutionSize = cocos2d::Size(768, 1136);

    and

    glview->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, ResolutionPolicy::NO_BORDER);

     

     

     

     

     

Login to reply