24ark / react-native-step-indicator

A simple react-native implementation of step indicator widget compatible with the ViewPager and ListView.
Apache License 2.0
1.44k stars 312 forks source link

full-width support for step-indicator #43

Open tharhtet opened 6 years ago

tharhtet commented 6 years ago

May I know how can I make full-width even if I use for at least 3 steps?

36137085_774052942802529_6880369954143600640_n

EslamNasser commented 6 years ago

+1 I need to know if this is possible as well

abhigyan9301 commented 5 years ago

I need help https://stackoverflow.com/questions/56440257/how-to-implement-stepindicator-in-react-native

abhigyan9301 commented 5 years ago

Facing difficulties in using renderLabel

<StepIndicator customStyles={stepIndicatorStyles} currentPosition={currentStepPosition.length} stepCount={Steplabels.length} labels={Steplabels} renderLabel ={() => this.renderLabel(Steplabels.length,"Second",Steplabels,currentStepPosition.length)} direction="vertical" />

renderLabel = ({ position, stepStatus, label, currentPosition }) => { console.log("hhhhhhhhhhhhhhhhhh",position) return ( <Text style={ position === currentPosition ? styles.stepLabelSelected : styles.stepLabel }

{label} )

alexander-babenko-electa commented 4 years ago

Facing difficulties in using renderLabel

<StepIndicator customStyles={stepIndicatorStyles} currentPosition={currentStepPosition.length} stepCount={Steplabels.length} labels={Steplabels} renderLabel ={() => this.renderLabel(Steplabels.length,"Second",Steplabels,currentStepPosition.length)} direction="vertical" />

renderLabel = ({ position, stepStatus, label, currentPosition }) => { console.log("hhhhhhhhhhhhhhhhhh",position) return ( <Text style={ position === currentPosition ? styles.stepLabelSelected : styles.stepLabel }

{label}

)

You are using destructurisation for object without the object. renderLabel = ({ position, stepStatus, label, currentPosition }) Try to remove mustaches: renderLabel = (position, stepStatus, label, currentPosition)

Talha-Jawed commented 3 years ago

worked fine from my side

<View style={{ width: screenWidth + 80, alignSelf: 'center' }}>
      <StepIndicator
        customStyles={StepIndicatorStyles}
        currentPosition={step}
        labels={labels}
        stepCount={3}
      />
</View>

screen width get in Dimensions from react-native

afzalali27 commented 2 years ago

I achieved this by giving marginHorizontal: -26 to the parent container in which I am using StepIndicator