You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When presenting a sheet with presentation detents, the sticky header functionality breaks a bit because the header tries to grow to the top of the screen, but the presentationDetent cuts it off.
The stretchiness functionality doesn't necessarily need to work on small detents, but would be nice for the header to stick to the top.
@morluna I think that maybe the stretch should be disabled altogether when being presented in a sheet. Do you know if it's possible to detect whether or not the view is in a sheet?
@danielsaidi On the parent view, you could just use .presentationDetents(:selection:) and a state property to know when it changed.
There isn't a way for nested views (like the scroll view with sticky header) to know what presentation detent it's on out of the box, but maybe you can created a custom environment property for it?
structPresentationDetentPreferenceKey:PreferenceKey{staticvardefaultValue:PresentationDetent=.large
staticfunc reduce(value:inoutPresentationDetent, nextValue:()->PresentationDetent){
value =nextValue()}}structPresentationDetentEnvironmentKey:EnvironmentKey{staticletdefaultValue:PresentationDetent=.large
}extensionEnvironmentValues{varpresentationDetent:PresentationDetent{get{self[PresentationDetentEnvironmentKey.self]}set{self[PresentationDetentEnvironmentKey.self]= newValue }}}
When presenting a sheet with presentation detents, the sticky header functionality breaks a bit because the header tries to grow to the top of the screen, but the presentationDetent cuts it off.
The stretchiness functionality doesn't necessarily need to work on small detents, but would be nice for the header to stick to the top.
Simulator.Screen.Recording.-.iPhone.14.Pro.-.2023-03-14.at.08.51.58.MP4
The text was updated successfully, but these errors were encountered: