Skip to content

Anchor Adaptive Banner height calculation failed #514

@pentalogia

Description

@pentalogia

When I get the content view through the Tab view menu in iOS Swiftui, a More button(‘<’) is created at the top forcibly from the fifth Tab view content screen. Apple forces it to be configured that way. At this time, if I request an Anchor Adaptive Banner(bottom) using ‘currentOrientationAnchoredAdaptiveBanner’, cannot get the vertical length/height of the anchor adaptive banner. The default size of 50 is only returned. if I switch to another view screen and then come back to the tab view screen, it starts reloading and returns to the corrected height of the adaptive banner. It seems geometryreader can't calcurate the row of the More button(‘<’) in which Apple forces.

var body: some View {
  GeometryReader { geometry in
    let adSize = currentOrientationAnchoredAdaptiveBanner(width: geometry.size.width)
  VStack {
      Spacer()
      BannerViewContainer(adSize)
        .frame(height: adSize.size.height)   // <—— 
    }.frame(height: adSize.size.height)  /// <—- 
  } 

// issue point
/// This frame wraps it again in case this function can't calculate the height of banner in the view itself. Without this, the height of banner can't be calculated at the entire height (Always half of Screen).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions