Бета-версия Jetpack Compose не может обеспечить полную совместимость из-за переопределения fitSystemWindows. ⇐ Android
Бета-версия Jetpack Compose не может обеспечить полную совместимость из-за переопределения fitSystemWindows.
I have upgraded Compose for my app from 1.0.0-alpha10 to current latest of 1.0.0-beta03
I want to layout my activity contents edge to edge, underneath system bars.
Among other things I have used the below code to tell the system this intent.
window?.run { WindowCompat.setDecorFitsSystemWindows(this, false) } This has worked well in the previous Compose version, but it seems like beta03 (or may be an earlier version after alpha10) started setting fitsSystemWindows to true and makes the above code ineffective. (Moving it below setContent { } had no effect either)
In the Layout Explorer I can see the decorView and its direct child LinearLayout now has fitsSystemWindows = true
I have below code as a temp solution which works to get the expected behavior.
// code that used to work on alpha10 window?.run { WindowCompat.setDecorFitsSystemWindows(this, false) } setContent { MyApp() } // temp workaround for beta03 window?.decorView?.fitsSystemWindows = false window?.decorView?.allViews?.forEach { view -> view.fitsSystemWindows = false } This feels like I'm fighting against Compose for the desired result.
What is the "correct" way to tell Compose not to override fitsSystemWindows?
Источник: https://stackoverflow.com/questions/670 ... temwindows
I have upgraded Compose for my app from 1.0.0-alpha10 to current latest of 1.0.0-beta03
I want to layout my activity contents edge to edge, underneath system bars.
Among other things I have used the below code to tell the system this intent.
window?.run { WindowCompat.setDecorFitsSystemWindows(this, false) } This has worked well in the previous Compose version, but it seems like beta03 (or may be an earlier version after alpha10) started setting fitsSystemWindows to true and makes the above code ineffective. (Moving it below setContent { } had no effect either)
In the Layout Explorer I can see the decorView and its direct child LinearLayout now has fitsSystemWindows = true
I have below code as a temp solution which works to get the expected behavior.
// code that used to work on alpha10 window?.run { WindowCompat.setDecorFitsSystemWindows(this, false) } setContent { MyApp() } // temp workaround for beta03 window?.decorView?.fitsSystemWindows = false window?.decorView?.allViews?.forEach { view -> view.fitsSystemWindows = false } This feels like I'm fighting against Compose for the desired result.
What is the "correct" way to tell Compose not to override fitsSystemWindows?
Источник: https://stackoverflow.com/questions/670 ... temwindows
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
FitSystemWindows не работает в пользовательском макете в NavigationView
Anonymous » » в форуме Android - 0 Ответы
- 9 Просмотры
-
Последнее сообщение Anonymous
-
-
-
FitSystemWindows не работает в пользовательском макете в NavigationView
Anonymous » » в форуме Android - 0 Ответы
- 9 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Как обеспечить совместимость IP-камеры для потоковой передачи с OpenCV в Python?
Anonymous » » в форуме Python - 0 Ответы
- 22 Просмотры
-
Последнее сообщение Anonymous
-