我正在使用下拉菜单https://shoutem.github.io/docs/ui-toolkit/components/dropdown-menu
默认情况下,它被设置为透明菜单中的最后一个项目,我想知道是否可以禁用它,因为即时消息仅在菜单中使用了2个项目,这使我的第二个项目变得透明且几乎不可见。
恐怕无法通过简单的bool道具或类似功能禁用它。将来可能会添加此选项。现在,我建议您尝试编辑UI工具包的主题。
如果您使用的是Shoutem平台,则可以创建一个可以在应用程序中使用的自定义主题(作为新的自定义扩展名)。如果没有,您可以手动定义默认的UI工具箱主题,在该主题中“禁用”此渐变。
在这两种情况下,您都需要覆盖DropDownModal组件主题样式。
这是传递给组件的默认主题样式。
'shoutem.ui.DropDownModal': {
modal: {
'shoutem.ui.Button.close': {
'shoutem.ui.Icon': {
color: changeColorAlpha(variables.subtitle.color, 0.5),
fontSize: 24,
},
position: 'absolute',
bottom: 25,
left: 0,
right: 0,
},
flex: 1,
justifyContent: 'center',
alignItems: 'center',
paddingVertical: 20,
backgroundColor: changeColorAlpha(variables.backgroundColor, 0.97),
},
....
},
您可以为工具箱定义一个新主题,该主题将覆盖此特定的style属性。所以你可以传递类似
'shoutem.ui.DropDownModal': {
modal: {
backgroundColor: 'transparent',
},
},
我们正在使用backgroundColor属性在实际下拉菜单上方设置叠加层的样式。
如果您不使用Shoutem平台,则可以使用从UI工具箱导出的getTheme来获取默认主题。这将为您提供解析的样式对象,您可以在其中合并您所做的更改。然后,通过使用,将新主题设置为当前主题@shoutem/theme
。
import { Theme } from '@shoutem/theme';
Theme.setDefaultThemeStyle(myCustomTheme);
如果您使用的是Shoutem平台,则可以通过创建一个新的主题扩展名来创建相同的替代,该新主题扩展名合并来自Rubicon主题扩展名的默认样式。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句