0

这很好用(图标为白色且大小正确):

// Logo definition
import { Icon } from '@ui-kitten/components'

const Logo = props => <Icon {...props} name='logo' pack='app' />

// index.js

  <Logo style={{
    width: 200,
    height: 200,
    tintColor: theme["basic-color-100"]
  }}/>

然后,我把元素变成了一个样式组件:

// index.js:

    <StyledLogo />

// styles.js

    export const StyledLogo = styled(Logo)`
      width: 200px;
      height: 200px;
      tint-color: ${({theme}) => {theme["basic-color-100"]}
    `

注意:如果我使用内联样式更改 StyledLogo 的颜色,它也不起作用

tint-color 属性现在被完全忽略(图标大小合适,但完全是黑色)。我该如何解决?

4

0 回答 0