Javascript 顶部的本机基本图标按钮
Native base是设置react/react Native样式的一个很好的库。我对图标按钮只有一个问题,我希望顶部的图标和底部的文本不要对齐。我曾尝试将图标和文本的self:'center'对齐,但不起作用。有人能帮忙吗?非常感谢Javascript 顶部的本机基本图标按钮,javascript,react-native,native-base,Javascript,React Native,Native Base,Native base是设置react/react Native样式的一个很好的库。我对图标按钮只有一个问题,我希望顶部的图标和底部的文本不要对齐。我曾尝试将图标和文本的self:'center'对齐,但不起作用。有人能帮忙吗?非常感谢 <Button transparent style={styles.capturebtn}> <Icon name="camera" type="MaterialCommunityIcons" style={styles.capture
<Button transparent style={styles.capturebtn}>
<Icon name="camera" type="MaterialCommunityIcons" style={styles.capturebtnicon}/>
<Text style={styles.capturebtntxt} uppercase={false}>Open Camera</Text>
</Button>
capturebtntxt:{
alignSelf:'center',
fontSize:15,
fontFamily:'Gotham-Medium',
color:'#AAAAAA'
},
capturebtnicon:{
alignSelf:'center',
color:'#E3E3E3',
fontSize:35
},
capturebtn:{
elevation:0,
borderColor:'#e5e5e5',
borderWidth:1,
borderRadius:7,
justifyContent:'center',
alignItems:'center',
width:((Dimensions.get('window').width - 150 - 60) / 2) - 10
},
开放式摄像机
CaptureBtnText:{
alignSelf:“中心”,
尺寸:15,
fontFamily:“高谭-中等”,
颜色:“#AAAAA”
},
capturebtnicon:{
alignSelf:“中心”,
颜色:“#e3”,
尺码:35
},
capturebtn:{
海拔:0,
边框颜色:“#e5”,
边框宽度:1,
边界半径:7,
辩护内容:'中心',
对齐项目:'中心',
宽度:((Dimensions.get('window')。宽度-150-60)/2)-10
},
我找到了按钮的flexDirection:“列”修复了此问题。=) 或者您可以使用垂直
垂直-真-布尔-使用此道具垂直对齐页脚元素
比如图标和文本
范例