Skip to content

Update intrinsic height of view based off new layout constraints  #453

@daihovey

Description

@daihovey

Description

While using an intrinsic layout (IntrinsicPanelLayout see below) I would like to update the content inside the view, which can mean a change in height. Is it possible to tell the layout adaptor to recalculate its constraints based off the content's new height. I've tried fpc.invalidateLayout() after setting up the new constraints, but the height of the fpc remains the same.

class IntrinsicPanelLayout: FloatingPanelBottomLayout {
    override var initialState: FloatingPanelState { .full }
    override var anchors: [FloatingPanelState: FloatingPanelLayoutAnchoring] {
        [
            .full: FloatingPanelIntrinsicLayoutAnchor(absoluteOffset: 0.0, referenceGuide: .safeArea)
        ]
    }
}

Thanks 🙏

How do you display panel(s)?

  • Present modally

How many panels do you displays?

  • 1

Environment

Library version
2.3.0
Installation method

  • CocoaPods

iOS version(s)
14.0

Xcode version
12.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions