Skip to content

Commit 42a4045

Browse files
committed
Fixed layout for promo banner.
1 parent dfbc28c commit 42a4045

File tree

3 files changed

+12
-23
lines changed

3 files changed

+12
-23
lines changed

Example App/NativeUIKit.xcodeproj/xcshareddata/xcschemes/watchOS Example.xcscheme

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -54,46 +54,33 @@
5454
debugDocumentVersioning = "YES"
5555
debugServiceExtension = "internal"
5656
allowLocationSimulation = "YES">
57-
<RemoteRunnable
58-
runnableDebuggingMode = "2"
59-
BundleIdentifier = "com.apple.Carousel"
60-
RemotePath = "/(null)">
57+
<BuildableProductRunnable
58+
runnableDebuggingMode = "0">
6159
<BuildableReference
6260
BuildableIdentifier = "primary"
6361
BlueprintIdentifier = "F4C33E2F26C932C8001A28B1"
6462
BuildableName = "watchOS Example.app"
6563
BlueprintName = "watchOS Example"
6664
ReferencedContainer = "container:NativeUIKit.xcodeproj">
6765
</BuildableReference>
68-
</RemoteRunnable>
66+
</BuildableProductRunnable>
6967
</LaunchAction>
7068
<ProfileAction
7169
buildConfiguration = "Release"
7270
shouldUseLaunchSchemeArgsEnv = "YES"
7371
savedToolIdentifier = ""
7472
useCustomWorkingDirectory = "NO"
7573
debugDocumentVersioning = "YES">
76-
<RemoteRunnable
77-
runnableDebuggingMode = "2"
78-
BundleIdentifier = "com.apple.Carousel"
79-
RemotePath = "/(null)">
74+
<BuildableProductRunnable
75+
runnableDebuggingMode = "0">
8076
<BuildableReference
8177
BuildableIdentifier = "primary"
8278
BlueprintIdentifier = "F4C33E2F26C932C8001A28B1"
8379
BuildableName = "watchOS Example.app"
8480
BlueprintName = "watchOS Example"
8581
ReferencedContainer = "container:NativeUIKit.xcodeproj">
8682
</BuildableReference>
87-
</RemoteRunnable>
88-
<MacroExpansion>
89-
<BuildableReference
90-
BuildableIdentifier = "primary"
91-
BlueprintIdentifier = "F4C33E2F26C932C8001A28B1"
92-
BuildableName = "watchOS Example.app"
93-
BlueprintName = "watchOS Example"
94-
ReferencedContainer = "container:NativeUIKit.xcodeproj">
95-
</BuildableReference>
96-
</MacroExpansion>
83+
</BuildableProductRunnable>
9784
</ProfileAction>
9885
<AnalyzeAction
9986
buildConfiguration = "Debug">

Sources/NativeUIKit/Views/NativePromoView.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ open class NativePromoView: SPView {
7676
addSubview(descriptionLabel)
7777
addSubview(iconView)
7878
addSubview(button)
79-
79+
areaView.layoutMargins = .init(horizontal: 24, vertical: 24)
8080
iconView.applyPerspective(.iOS14WidgetAnimatable)
8181
}
8282

@@ -95,11 +95,13 @@ open class NativePromoView: SPView {
9595
super.layoutSubviews()
9696
areaView.frame = .init(x: layoutMargins.left, y: layoutMargins.top, width: layoutWidth, height: areaView.frame.height)
9797

98-
titleLabel.layoutDynamicHeight(width: layoutWidth)
98+
let labelsWidth = areaView.layoutWidth
99+
100+
titleLabel.layoutDynamicHeight(width: labelsWidth)
99101
titleLabel.setXCenter()
100-
titleLabel.frame.origin.y = areaView.frame.origin.y + 24
102+
titleLabel.frame.origin.y = areaView.frame.origin.y + areaView.layoutMargins.top
101103

102-
descriptionLabel.layoutDynamicHeight(width: layoutWidth)
104+
descriptionLabel.layoutDynamicHeight(width: labelsWidth)
103105
descriptionLabel.setXCenter()
104106
descriptionLabel.frame.origin.y = titleLabel.frame.maxY + 3
105107

0 commit comments

Comments
 (0)