简体   繁体   中英

Jetpack compose: Scaffold navigationBarsPadding not working properly

I'm using Jetpack compose with Scaffold. As you can see it doesn't work properly.

Scaffold(
    modifier = Modifier
        .fillMaxSize()
        .navigationBarsPadding(),
) {
    ...
}

在此处输入图像描述

Note that I have called WindowCompat.setDecorFitsSystemWindows(window, false) on host activity.

Also this result is happing on Lg G4 - Api 26

You can try add this code, set in your root

ProvideWindowInsets {}

WindowCompat.setDecorFitsSystemWindows(window, false) :Indicates that the content can extend to the system bar

In your case, you can use: WindowCompat.setDecorFitsSystemWindows(window, true)

Example :

Scaffold(
    modifier = Modifier
        .fillMaxSize(),
) {
    ...
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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