commit e6deff7bc4d6cb2a6275078a9ac325c1d5071c31
parent b39155d738505582961cf14b30f0c5f526d413fd
Author: Marc Stibane <marc@taler.net>
Date: Tue, 24 Sep 2024 12:15:41 +0200
fixedInnerHeight
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/TalerWallet1/Views/HelperViews/View+fixedInnerHeight.swift b/TalerWallet1/Views/HelperViews/View+fixedInnerHeight.swift
@@ -31,12 +31,13 @@ extension View {
@available(iOS 16.0, *)
func fixedInnerHeight(_ sheetHeight: Binding<CGFloat>) -> some View {
padding()
- .background {
+ .overlay { // .background doesn't work
GeometryReader { proxy in
Color.clear.preference(key: InnerHeightPreferenceKey.self, value: proxy.size.height)
}
}
.onPreferenceChange(InnerHeightPreferenceKey.self) { newHeight in
+// print("InnerHeightPreferenceKey \(newHeight)")
sheetHeight.wrappedValue = newHeight
}
.presentationDetents([.height(sheetHeight.wrappedValue)])