gpt4 book ai didi

android - 为整个应用设置背景颜色。 Android, Jetpack 撰写

转载 作者:行者123 更新时间:2023-12-04 23:43:35 26 4
gpt4 key购买 nike

我需要为整个应用程序设置背景颜色。在 xml 中,我们使用 android:background在 fragment 或 Activity 中标记。
Compose 有什么模拟功能? Surface argument对于主题 colorPalette 没有帮助。寻找您的解决方案。

最佳答案

您可以将您的应用程序放在 Box 中有需要的背景:

setContent {
YourTheme {
Box(
modifier = Modifier
.fillMaxSize()
.background(Color.Yellow)
) {
YourApp()
}
}
}

关于android - 为整个应用设置背景颜色。 Android, Jetpack 撰写,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68972480/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com