Reactjs 反应本机对齐项目:基线不工作
我需要将2个svg图标和一个带有一些文本的视图与基线对齐,但正如您从快照中看到的,它不起作用。 这是我想要的结果: 代码如下:Reactjs 反应本机对齐项目:基线不工作,reactjs,react-native,Reactjs,React Native,我需要将2个svg图标和一个带有一些文本的视图与基线对齐,但正如您从快照中看到的,它不起作用。 这是我想要的结果: 代码如下: <View style={styles.header}> <TouchableOpacity onPress={() => navigation.openDrawer()} style={{marginRight: 20}}> <MenuIcon /> </Touch
<View style={styles.header}>
<TouchableOpacity onPress={() => navigation.openDrawer()} style={{marginRight: 20}}>
<MenuIcon />
</TouchableOpacity>
<View>
<Text style={styles.date}>24 ottobre 2019</Text>
<Text style={styles.title}>Compiti</Text>
</View>
<TouchableOpacity onPress={() => navigation.navigate({routeName: 'Calendary'})} style={{position: 'absolute', right:0}}>
<CalendarIcon width={50} height={50} />
</TouchableOpacity>
</View>
您的
标题
样式应如下所示:
header: {
flex: 1,
flexDirection: 'row',
alignItems: 'center', // add center instead of flex-end
}
我希望它处于基线,而不是中间
header: {
flex: 1,
flexDirection: 'row',
alignItems: 'center', // add center instead of flex-end
}