Skip to content

Commit 49cd857

Browse files
authored
Merge pull request #15 from cybozu/scroll-bar-layout-2
Improve layout of scroll bars in LicenseView (Take 2)
2 parents 73728d1 + 85fc393 commit 49cd857

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

Sources/LicenseList/LicenseView.swift

+8-13
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,14 @@ public struct LicenseView: View {
1818
}
1919

2020
public var body: some View {
21-
GeometryReader { geometry in
22-
ScrollView {
23-
Text(attributedLicenseBody)
24-
.font(.caption)
25-
.padding()
26-
.frame(width: geometry.size.width)
27-
.padding(.leading, geometry.safeAreaInsets.leading)
28-
.padding(.trailing, geometry.safeAreaInsets.trailing)
29-
.onAppear {
30-
attributedLicenseBody = attribute(library.licenseBody)
31-
}
32-
}
33-
.ignoresSafeArea(edges: .horizontal)
21+
ScrollView {
22+
Text(attributedLicenseBody)
23+
.font(.caption)
24+
.frame(maxWidth: .infinity, alignment: .leading)
25+
.padding()
26+
.onAppear {
27+
attributedLicenseBody = attribute(library.licenseBody)
28+
}
3429
}
3530
.navigationBarTitle(library.name)
3631
}

0 commit comments

Comments
 (0)