简体   繁体   English

ProvideWindowInsets 是什么意思?

[英]What does ProvideWindowInsets means?

我正在尝试学习 Jetpack Compose,在 JetChat 应用程序中我发现了以下代码,但是我不明白它到底做了什么。

ProvideWindowInsets(consumeWindowInsets = false).

ProvideWindowInsets() {} means you can access the window inset values with LocalWindowInsets.current in any of the child compose functions inside ProvideWindowInsets() {}. ProvideWindowInsets() {} 表示您可以使用 LocalWindowInsets.current 在 ProvideWindowInsets() {} 内的任何子撰写函数中访问窗口插入值。

With consumeWindowInsets = false, the window insect values keep passing down the view hierarchy.当consumeWindowInsets = false 时,窗口昆虫值不断向下传递视图层次结构。 For a visual explanation, check out Chris Banes's slides, https://chris.banes.dev/becoming-a-master-window-fitter-lon/ .如需直观说明,请查看 Chris Banes 的幻灯片, https: //chris.banes.dev/becoming-a-master-window-fitter-lon/。 Look for the slides near the end, "WindowInsets will be passed down until it has been consumed".寻找接近结尾的幻灯片,“WindowInsets 将被传递,直到它被消耗”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM