Skip to main content

BoxWithConstraints

Function BoxWithConstraints 

Source
pub fn BoxWithConstraints<F>(modifier: Modifier, content: F) -> View
where F: Fn(BoxWithConstraintsScope) -> View + 'static,
Expand description

A SubcomposeLayout specialized for the “show different content based on the available width/height” use case.

The supplied content receives a BoxWithConstraintsScope containing the current constraints (in dp) and returns the View to render. The resulting view fills the available space.