-
-
Notifications
You must be signed in to change notification settings - Fork 514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to desactivate attraction for positions between full and tip #434
Comments
Specify the panel move's boundary will help you. |
Hi, Thanks for your answer, To suit my need I finally change FloatingPanelStates, this way (adding 2 intermediate states) : @objc(Full) public static let full: FloatingPanelState = FloatingPanelState(rawValue: "full", order: 1000) all good for me you could open FloatingPanelState to be able to easily add states |
Hi, @i-arun-samui. Could you tell me how you use |
hi, On iPad I'm thinking to add more intermediates states class VerticalFloatingPanelLayout: FloatingPanelLayout { |
this line doesn't stop attraction |
Him @i-arun-samui. I've created PR #438 to create a custom state like
Yes, it does because it's a delegate method. You are able to prevent a panel bounce by using a critical damped spring behavior which can be defined in FloatingPanelBehavior.springDecelerationRate. |
Hi, |
Description
Expected behavior
I would like to be able to have to floatingpanel to stop where the user stop dragging, with limits on top and bottom
Actual behavior
the floatingpanel goes to top, half, tip
Steps to reproduce
Code example that reproduces the issue
How do you display panel(s)?
floatingPanel = FloatingPanelController()
floatingPanel.delegate = self
floatingPanel.delegate?.floatingPanelDidEndDragging?(floatingPanel, willAttract: false)
floatingPanel.layout = MyFloatingPanelLayout()
let storyBoard = UIStoryboard(name: "Main", bundle: nil)
let contentVC = storyBoard.instantiateViewController(withIdentifier: "pagingPage") as? Paging
floatingPanel.set(contentViewController: contentVC)
floatingPanel.addPanel(toParent: self)
class MyFloatingPanelLayout: FloatingPanelLayout {
let position: FloatingPanelPosition = .bottom
let initialState: FloatingPanelState = .tip
var anchors: [FloatingPanelState: FloatingPanelLayoutAnchoring] {
return [
.full: FloatingPanelLayoutAnchor(absoluteInset: 0.0, edge: .top, referenceGuide: .safeArea),
.half: FloatingPanelLayoutAnchor(fractionalInset: 0.5, edge: .bottom, referenceGuide: .safeArea),
.tip: FloatingPanelLayoutAnchor(absoluteInset: 20.0, edge: .bottom, referenceGuide: .safeArea),
]
}
}
How many panels do you displays?
1
Environment
iphone ipad MacOS catalyst
Library version
2.1.0
Installation method
CocoaPods
iOS version(s)
ios 14
Xcode version
12.2
The text was updated successfully, but these errors were encountered: