Skip to content

Commit 54ac54f

Browse files
committed
Fixed layout for container.
1 parent 82cc500 commit 54ac54f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Sources/NativeUIKit/Views/NativePromoView.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ open class NativePromoView: SPView {
8484

8585
open func layout(y: CGFloat) {
8686
guard let superview = self.superview else { return }
87-
let width = min(superview.readableWidth, NativeLayout.Sizes.actionable_area_maximum_width)
87+
var width = min(superview.readableWidth, NativeLayout.Sizes.actionable_area_maximum_width)
88+
if (width == .zero) && (superview.layoutWidth != .zero) { width = superview.layoutWidth }
8889
setWidthAndFit(width: width)
8990
setXCenter()
9091
frame.origin.y = y
@@ -133,6 +134,7 @@ open class NativePromoContainerView: SPView {
133134

134135
open override func commonInit() {
135136
super.commonInit()
137+
layoutMargins = .zero
136138
addSubview(promoView)
137139
}
138140

0 commit comments

Comments
 (0)