Kis*_*rda 4 react-native native-base
我正在使用NativeBase Header。在标题中,我有购物车和心愿单等按钮。但我无法更改该图标的颜色。
这是我的标题代码:
<Header>
<Left>
<Button transparent onPress={props.onMenuPress}>
<Icon type="Ionicons" name="menu" color="#ff0000" />
</Button>
</Left>
<Body>
<Title>{props.title}</Title>
</Body>
<Right>
<Button transparent onPress={props.onWishlistPress}>
<Icon name="heart" active={false} color="#ff0000" />
</Button>
<Button transparent onPress={props.onCartPress} icon>
<Icon name="cart" active={false} color="#ff0000" />
</Button>
</Right>
</Header>
Run Code Online (Sandbox Code Playgroud)
请任何人都可以告诉我这里有什么问题?
hon*_*lop 10
它显示在Native-base文档中。对于 Icon,请Native-base使用React-native-vector-icons模块,该模块允许您设置colors并sizes通过style.
完美、清晰、高清晰度的图标和像素理想的字体,NativeBase以非常高的一流水平保留问题。您的计划中将不断有像素完美的图标。这是一个 repo,列出了可用react-native-vector-icons图标系列的图标。回购
使用 React Native Vector Icons 中的 Ionicons
<Icon name='home' />
<Icon ios='ios-menu' android="md-menu" style={{fontSize: 20, color: 'red'}}/>
<Icon type="FontAwesome" name="home" />
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2265 次 |
| 最近记录: |