如何在jetpack compose BasicTextField中设置边框颜色?
我使用 package androidx.compose.foundation.text
中的 BasicTextField
,它具有默认的灰色字段颜色,如下所示:
我不想要这个灰色突出显示,因此我想将backgroundColor完全设置为黑色:
BasicTextField(
modifier = Modifier
.background(Color.Black)
)
有一个边框仍然是灰色的。
保留边框尺寸是可以的,但我想要像这里一样有一个完整的黑色背景
我该如何管理?
编辑:我尝试使用 color = Color.Black
添加 border()
修饰符 - 但徒劳。
I use BasicTextField
from package androidx.compose.foundation.text
and it has a default grey field color as visible here:
I do not want this grey highlight, therefore I want to set the backgroundColor completely to black:
BasicTextField(
modifier = Modifier
.background(Color.Black)
)
But this does take effect only partially as visible here
There is a border still having grey color.
It is ok to keep the border dimensions, but I would like to have a complete black background as here
How can I manage this?
Edit: I tried to add a border()
modifier with color = Color.Black
- in vain.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定您的可组合项的代码,请尝试:
I'm not sure about the code of your Composable,please try: