Composable Function

asPaddingValues

Convert a WindowInsets to a PaddingValues and uses LocalDensity for DP to pixel conversion.

asPaddingValues

Source set: Common
@Composable
public fun WindowInsets.asPaddingValues(): PaddingValues

Convert a WindowInsets to a PaddingValues and uses LocalDensity for DP to pixel conversion. PaddingValues can be passed to some containers to pad internal content so that it doesn't overlap the insets when fully scrolled. Ensure that the insets are consumed after the padding is applied if insets are to be used further down the hierarchy.

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: