zbtang / React-Native-ViewPager

ViewPager and Indicator component for react-native on both android and ios.
950 stars 276 forks source link

How to align the selected title to center?? #159

Open basanthalluri opened 5 years ago

basanthalluri commented 5 years ago

Hi,

I am using PagerTitleIndicator for scrollable tab and I want to display the selected item to the centre when selecting this.

I am attaching the screenshot Screen Shot 2019-04-09 at 12 11 06 PM In the screen I have selected building gude so I need the position to the center not to left most

I need every selected Item should be aligned to center except the last and first item Ca you help me how to achieve this.

luatnd commented 5 years ago

Hi, I've met the same issue. After read the source code, I decide to fork and modify it by myself, not sure this modification can be a PR or not. You can pull the code or see the changes here: https://github.com/luatnd/React-Native-ViewPager/commit/0d51a08b78663c9c0dc5df12cc9e026487bd68c1

Or too include my version, change your package.json from

"rn-viewpager": "^x.x.x",

to

"rn-viewpager": "https://github.com/luatnd/React-Native-ViewPager.git",