Skip to content

Commit

Permalink
Merge pull request #11 from koher/scroll-bar-layout
Browse files Browse the repository at this point in the history
Improve layout of scroll bars in LicenseView
  • Loading branch information
Kyome22 authored Sep 20, 2023
2 parents 3bcb310 + 150fbea commit 2fe7ef0
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions Sources/LicenseList/LicenseView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,19 @@ public struct LicenseView: View {
}

public var body: some View {
ScrollView {
Text(attributedLicenseBody)
.font(.caption)
.padding()
.onAppear {
attributedLicenseBody = attribute(library.licenseBody)
}
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)
}
.navigationBarTitle(library.name)
}
Expand Down

0 comments on commit 2fe7ef0

Please sign in to comment.