I am using jetpack compose for Android development.
In dark mode, the background of the TextField is Color.Black. However, after tapping on the TextField, when the keyboard is displayed, the background color changes to white for a moment.
This seems to be due to the use of adjustResize. However, without it, some parts of the text will be off the screen and cannot be edited while typing. Therefore, I believe either of the following is an improvement.
- Change the color to black while maintaining adjustResize.
- Solve the above problem of text sticking out in a different way than adjustResize
This is very ugly. How can I change this white background to black?
Thank you in advance.
class EditorActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
TextField(
value = "",
onValueChange = {},
modifier = Modifier.background(Color.Black).fillMaxSize()
)
}
}
}
my activity setting in AndroidManifest.xml
<activity
android:name=".ui.screen.episodeEdit.EditorActivity"
android:exported="false"
android:theme="@style/Theme.Nobel_editor"
android:windowSoftInputMode="adjustResize"></activity>


