Forums

OverviewFelgo Plugins Support › AdMobBanner alignement

Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #18121

    Witold Walkiewicz

    Hi,

    I’m trying to put AdMobBanner in the bottom of my app and I’m not sure how to put AdMobBanner.Smart to the bottom. Example below fills bottom part of the screen with red, and the banner is on top of rectangle (and i want it to be in the bottom).

    Rectangle {
                width: 480
                height: 50
    
                id: adRect
                anchors {
                    bottom: gameScene.gameWindowAnchorItem.bottom
                    top: boardWithBorder.bottom
                    topMargin: 16
                    horizontalCenter: boardWithBorder.horizontalCenter
                }
                color: "red"
    
                AdMobBanner {
                    id: adMobBanner
                    adUnitId: "(my unit id)"
                    banner: AdMobBanner.Smart
    
                    anchors.fill: parent
                }
            }

     

    #18124

    Alex
    Felgo Team

    Hi Witold,

    can you post the full running code example (without your ad unit id of course)? It would be great if you can cut down your code to a minimum so it still shows your issue and we can also see how the whole app ui is set up.

    Cheers,
    Alex

    #18126

    Witold Walkiewicz
    import Felgo 3.0
    import QtQuick 2.2
    import Felgo 3.0
    
    GameWindow {
        id: gameWindow
        activeScene: gameScene
    
         Scene {
            id: gameScene
    
            width: 480
            height: 640
    
            Item {
                id: boardWithBorder
    
                width: 400
                height: width
    
                anchors.centerIn: gameScene.gameWindowAnchorItem
    
                Rectangle {
                    id: boardBorder
                    width: parent.width
                    height: width
    
                }
            }
    
    
            Rectangle {
                width: 480
    
                id: adRect
                anchors {
                    bottom: gameScene.gameWindowAnchorItem.bottom
                    top: boardWithBorder.bottom
                    topMargin: 16
                    horizontalCenter: boardWithBorder.horizontalCenter
                }
                color: "red"
    
                AdMobBanner {
                    id: adMobBanner
                    adUnitId: "(my ad unit id)"
                    banner: AdMobBanner.Smart
    
                    anchors {
                        bottom: adRect.bottom
                    }
                }
            }
        }
    }
    

    Iit’s possible that I don’t get how to properly align elements in QT…

    #18127

    Witold Walkiewicz

    This is the result (Screenshot). I want the ad to be on the bottom of the screen..

     

     

    #18128

    Witold Walkiewicz

    Update: the screen in previous post was taken on LG G6 (Android) and the ad is too high. On iPhone SE it’s too low (cropped)…

    #18144

    Alex
    Felgo Team

    Hi Witold,

    sorry for the late reply. I did some testing and could reproduce the issue. The AdMob item’s height seems not to match the actual ad height if used as child of a Scene. Thank you for reporting this! Could u put the banner outside of the Scene component and handle the visibility manually then?

    Cheers,
    Alex

Viewing 6 posts - 1 through 6 (of 6 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support