简体   繁体   English

SelectField-更改弹出框颜色

[英]SelectField - change popover color

Is it possible to change the SelectField 's popover background color in material-ui ? 是否可以在material-ui中更改SelectField的弹出框背景颜色?

I checked in the generated theme but there's no selectField or popover key. 我在生成的题材检查,但没有selectFieldpopover关键。 Tried changing menu 's backgroundColor and containerBackgroundColor but it had no effect on the SelectField 尝试更改menubackgroundColorcontainerBackgroundColor但对SelectField无效

Yes, it's possible. 是的,有可能。 Behind the scenes SelectField uses the DropDownMenu component and you can see here there is a property menuStyle - that's what you're gonna use to change the popover style. 在幕后, SelectField使用DropDownMenu组件,您可以在此处看到一个属性menuStyle-这将用于更改弹出框样式。
Example: 例:

<SelectField menuStyle={{background: '#ddd'}} ...otherProps >

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM