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.43k stars 312 forks source link

labelAlign property not being applied #66

Closed gtiongco95 closed 5 years ago

gtiongco95 commented 5 years ago

Hi there,

I have tried using the property "labelAlign" with either values 'right' or 'left' to align the labels to the either side. However, the labels' alignment does not update and is still has the default 'center' alignment.

rdgomt commented 5 years ago

Same here

amanjuneja3012 commented 5 years ago

same here

24ark commented 5 years ago

Can you try flex-start or flex-end and see if it works.

ddsr17 commented 5 years ago

Still doesn't work

gtiongco95 commented 5 years ago

The fix was in the line { alignItems: this.state.customStyles.labelAlign } where state was omitted. However, the values left and right only work for ios. If you want it to work with android as well you will need to use flex-start and flex-end.

ddsr17 commented 5 years ago

@gtiongco95 Could you elaborate a bit, where exactly is this { alignItems: this.state.customStyles.labelAlign } to be placed?

gtiongco95 commented 5 years ago

@ddsr17 it's located on line 287 of the StepIndicator.js file. It has been updated by the repo owner so it should just work now for you (:

gtl-himanshu commented 4 months ago
const customStyles = {
    labelAlign: 'flex-start', // <-- add this property to the custom styles object
};

other type {"center" | "flex-start" | "flex-end" | "stretch" | "baseline" | undefined}