Neal Sanche
03/17/2021, 8:25 PMLouis Pullen-Freilich [G]
03/17/2021, 8:41 PMBut doing so affects the colour of the text painted on itYep, in Material components such as
Text
and Icon
use content color provided by a parent surface (in this case a Scaffold
) - see the guide for more information: https://developer.android.com/jetpack/compose/themes#content-color
In this case since the background color is transparent, it should just default to the value for LocalContentColor.current
, since transparent isn't a color defined in the theme that has a reasonable content color. So the 'background' you have defined earlier probably isn't providing a correct content color hereNeal Sanche
03/17/2021, 8:54 PMNeal Sanche
03/17/2021, 8:56 PMNeal Sanche
03/17/2021, 8:57 PMLouis Pullen-Freilich [G]
03/17/2021, 8:58 PMColor.Black
. If you have a Surface
/ non-transparent outer Scaffold
/ etc in your actual app, then that is probably setting a different color for textNeal Sanche
03/17/2021, 9:05 PMScaffold
non-transparent, and set up a Box around the navhost, and put the static background content inside the box instead, and now I'm seeing the text colours I'm expecting. I'll modify the sample I posted above to be consistent with that.Neal Sanche
03/17/2021, 9:07 PMNeal Sanche
03/17/2021, 9:09 PM