Icons React Native flex box对齐图标和文本
在Icons React Native flex box对齐图标和文本,icons,react-native,flexbox,Icons,React Native,Flexbox,在react-native应用程序中,我使用'react-native-vector-icons/MaterialIcons' 我尝试使用答案是使用flex:1而不是高度。我还使用了flexDirection:'row',因为我有两个元素 navBarLeftButton: { paddingLeft: 8, width: 100, flex: 1, flexDirection: 'row', alignItems: 'center', justifyContent: '
react-native
应用程序中,我使用'react-native-vector-icons/MaterialIcons'
我尝试使用
答案是使用flex:1
而不是高度。我还使用了flexDirection:'row'
,因为我有两个元素
navBarLeftButton: {
paddingLeft: 8,
width: 100,
flex: 1,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'flex-start'
}
在名称前使用active关键字,并从本机库导入图标。
您也可以在文本中使用
。在这种情况下,它将遵循文本的样式
我的纽扣
下次您遇到此类问题时,请尝试在上创建一个示例项目,以便社区能够快速了解问题所在并提供高质量的解决方案。请详细说明您的答案,并显示一些示例代码。解释为什么你的答案与已经发布的答案不同。
navBarLeftButton: {
flex: 1,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'flex-start'
width: 100,
paddingLeft: 8
}
buttonText: {
color: 'rgba(255,255,255,0.70)',
fontSize: 14
}
navBarLeftButton: {
paddingLeft: 8,
width: 100,
flex: 1,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'flex-start'
}