0
我是0123,的新手任何人都可以请告诉我如何使用进度条创建一个标题菜单,如附加图像。任何意见,非常感谢...React-native导航进度条
我已经取得了进展,我怎样才能删除在每一步之间的空间?
<View style={styles.stepIndicatorBox}>
{stepsIds.map((step, idx) => {
const words = steps[step].split(' ');
const activeStepStyle = step === activeStep && styles.activeStep;
return (
<View key={`${step}${idx}`}>
<Svg height="25" width="100">
<Line
x1="10"
y1="10"
x2="100"
y2="10"
stroke={theme.colors.blue}
strokeWidth="2"
/>
<Circle
cx="50"
cy="10"
r="3"
stroke={theme.colors.blue}
strokeWidth="2.5"
fill={theme.colors.lightBlue}
/>
</Svg>
{words.map(w =>
<Text style={[styles.stepName, activeStepStyle]}>
{w}
</Text>
)}
</View>
);
})}
</View>
我的风格是:
const styles = StyleSheet.create({
sceneContainer: {
bottom: 0,
left: 0,
position: 'absolute',
right: 0,
top: 0,
},
stepIndicatorBox: {
height: theme.utils.em(4),
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
backgroundColor: theme.colors.lightBlue,
paddingHorizontal: theme.metrics.mainPadding,
},
activeStep: {
...theme.fontStyles.smallBold,
color: theme.colors.activeStepName,
fontWeight: 'bold',
},
stepName: {
...theme.fontStyles.small,
color: theme.colors.blue,
textAlign: 'center',
},
});
为什么向下票????????我还应该怎么说这个问题? – Bomber
不用担心,我为你优惠! :)我认为这是一个很好的问题,但我认为downvoter希望你展示你尝试过的东西,这在SO中是推荐的,例如参见[常见问题]。 – David
感谢您的解释,我现在明白了 – Bomber