Skip to content
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

Bugfix/fit to bounds constrains #359

Merged
merged 3 commits into from May 30, 2020
Merged

Bugfix/fit to bounds constrains #359

merged 3 commits into from May 30, 2020

Conversation

GrigoryUlanov
Copy link
Contributor

Fix for this issue #294

Constraints break when we set fitToBounds contentMode and surfaceView.contentInsets.

The main problem was in heightConstraint between contentView and FloatingPanelSurfaceView taking into account surfaceView.contentInsets and offConstraints from FloatingPanelLayoutAdapter which do not take into account surfaceView.contentInsets.

Constrains error example:

[LayoutConstraints] Unable to simultaneously satisfy constraints.
	Probably at least one of the constraints in the following list is one you don't want. 
	Try this: 
		(1) look at each constraint and try to figure out which you don't expect; 
		(2) find the code that added the unwanted constraint or constraints and fix it. 
(
    "<NSLayoutConstraint:0x600002010460 FloatingPanel.FloatingPanelSurfaceView:0x7feb4f46d170.bottom == FloatingPanel.FloatingPanelPassThroughView:0x7feb4f7736f0.bottom   (active)>",
    "<NSLayoutConstraint:0x6000020105a0 V:[FloatingPanel.FloatingPanelPassThroughView:0x7feb4f7736f0]-(0)-[FloatingPanel.FloatingPanelSurfaceView:0x7feb4f46d170]   (active)>",
    "<NSLayoutConstraint:0x600002010820 UIView:0x7feb4f472ec0.height == FloatingPanel.FloatingPanelSurfaceView:0x7feb4f46d170.height - 35   (active)>"
)

@scenee
Copy link
Owner

scenee commented May 28, 2020

@GrigoryUlanov Thank you so much for your PR!! I will confirm this issue and this fix just to be sure 👍

@scenee
Copy link
Owner

scenee commented May 30, 2020

This makes sense. I also confirmed it's working well for the intrinsic layout. I really appreciate it.

@scenee scenee merged commit 966caad into scenee:master May 30, 2020
scenee added a commit that referenced this pull request Nov 29, 2021
…nt mode (#519)

They were set to `.required - 1` is #359, which fixed #294. However #294
was an issue on `.fitToBounds` content mode. But because of #444 and #515,
if your panel’s content mode is `.static`, their priorities should be set to
`.required` on `.static` content mode.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants