Open chilimovpasha opened 3 years ago
Have the same problem. I see from readme that this FloatingPanelIntrinsicLayoutAnchor
is deprecated. Is there an alternative way of providing the same behaviour?
Have you tried with FloatingPanelAdaptiveLayoutAnchor
?
Yeah I actually did and it worked out in the end for me
Tell me, please, how can this problem be solved?
@DolganovAnton13 try looking at the samples that use FloatingPanelAdaptiveLayoutAnchor
Bug in samples when using FloatingPanelAdaptiveLayoutAnchor
If you set fpc.surfaceView.contentPadding = .init(top: 20, left: 0, bottom: 0, right: 0) then I expect that the size of the sheet will be calculated according to the principle of content + paddings
In fact, the size remains the same and does not take into account safearea
Open samples and go to TableViewControllerForAdaptiveLayout.
Change anchors to
var anchors: [FloatingPanelState : FloatingPanelLayoutAnchoring] {
return [
.full: FloatingPanelAdaptiveLayoutAnchor(
absoluteOffset: 0.0,
contentLayout: targetGuide,
referenceGuide: .safeArea,
contentBoundingGuide: .safeArea
)
]
}
Change numberOfRowsInSection to
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
5
}
4. Paint the table background red to visually see the size
tableView.backgroundColor = .red
As a result, we will get the following
if we add a padding at the top, then we get the following
fpc.surfaceView.contentPadding = .init(top: 20, left: 0, bottom: 0, right: 0)
How do you display panel(s)?
Present modally
How many panels do you displays?
Library version
Installation method
iOS version(s)
Xcode version
Description
I want to show simple panel which height will depend on content height and want to use autolayout and save safe area insets.
Expected behavior
The panel is showing with height based on content layouted by constrained, panel's moves by gestures do not shift the content, and all insets ara used.
Actual behavior
When I setup constraint to safe area the panel behavior becomes strange - content inside shifting and floating by itself. Or I cant save safe area properly.
Steps to reproduce
Code example that reproduces the issue
This is the func from my service which embed a view controller to floating panel.
The CustomFloatingPanelLayout
How do you display panel(s)?
How many panels do you displays?
Environment
Library version
2.3.1
Installation method
iOS version(s)
14.5.1
Xcode version
12.5