HomeiOS Developmentios - SwiftUI, UIViewController banner wrapper consumes an excessive amount of house

ios – SwiftUI, UIViewController banner wrapper consumes an excessive amount of house


Integrating AdMob right into a SwiftUI app, the Google pattern code makes use of a UIViewController to show banner advert. The banner view, stretches to the utmost doable top, inflicting show points. the next code demonstrates the problems:

struct SomeScreen: View {
    
    var physique: some View {
        VStack {
            Textual content("Some textual content")
            Spacer()
            BannerContentView(navigationTitle: "Banner").background(.crimson)   
        }
    }
}

BannerContentView implementation is taken from right here: https://github.com/googleads/googleads-mobile-ios-examples/blob/fundamental/Swift/superior/SwiftUIDemo/SwiftUIDemo/Banner/BannerContentView.swift (Copy / Pasted)

As might be seen within the screenshot, the BannerContentView consumes as a lot house as doable, having the Spacer() haven’t any impact. How can I modify BannerContentView which inherits UIViewController to take solely the house required by the banner?

enter image description here

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments