Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

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.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded