Edge-To-Edge выглядит по-разному на API 35 против API 31JAVA

Программисты JAVA общаются здесь
Anonymous
Edge-To-Edge выглядит по-разному на API 35 против API 31

Сообщение Anonymous »

Я попытался реализовать края к краю как для API 35, так и для Pre-API 35. < /p>
Однако результаты выглядят немного иначе. alt = "Введите описание изображения здесь" src = "https://i.sstatic.net/pbgudoqf.png"/>
Это мой код реализации.
// Source code in Activity.

private void edgeToEdgeIfPossible() {
if (android.os.Build.VERSION.SDK_INT {
// Get the insets for the system bars (status bar, navigation bar)
Insets theInsets = insets.getInsets(
WindowInsetsCompat.Type.systemBars() | WindowInsetsCompat.Type.displayCutout()
);

v.setPadding(
initialPadding.left + theInsets.left,
initialPadding.top + theInsets.top,
initialPadding.right + theInsets.right,
initialPadding.bottom + theInsets.bottom
);

// Return the insets to allow the system to continue processing them
return insets;
});
}
< /code>
Могу я узнать, как я могу решить такую ​​проблему? Спасибо.

Подробнее здесь: https://stackoverflow.com/questions/797 ... -vs-api-31

Вернуться в «JAVA»