Skip to content

Commit

Permalink
Merge pull request #15 from cybozu/scroll-bar-layout-2
Browse files Browse the repository at this point in the history
Improve layout of scroll bars in LicenseView (Take 2)
  • Loading branch information
Kyome22 authored Sep 28, 2023
2 parents 73728d1 + 85fc393 commit 49cd857
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions Sources/LicenseList/LicenseView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,14 @@ public struct LicenseView: View {
}

public var body: some View {
GeometryReader { geometry in
ScrollView {
Text(attributedLicenseBody)
.font(.caption)
.padding()
.frame(width: geometry.size.width)
.padding(.leading, geometry.safeAreaInsets.leading)
.padding(.trailing, geometry.safeAreaInsets.trailing)
.onAppear {
attributedLicenseBody = attribute(library.licenseBody)
}
}
.ignoresSafeArea(edges: .horizontal)
ScrollView {
Text(attributedLicenseBody)
.font(.caption)
.frame(maxWidth: .infinity, alignment: .leading)
.padding()
.onAppear {
attributedLicenseBody = attribute(library.licenseBody)
}
}
.navigationBarTitle(library.name)
}
Expand Down

0 comments on commit 49cd857

Please sign in to comment.