React-Native-ViewPager icon indicating copy to clipboard operation
React-Native-ViewPager copied to clipboard

How to show page indicator top of the view

Open ashanjayasundara opened this issue 6 years ago • 3 comments

how can i show page dot indicator on top of the parent view currently its show on bottom of the view

ashanjayasundara avatar May 03 '18 05:05 ashanjayasundara

you can pass a style prop with overrides for the default styling (which is position: absolute, bottom: 10)

try something along the lines of bottom: null, top: 0

beeglebug avatar May 03 '18 14:05 beeglebug

@beeglebug's solution didnt work for me, and caused the pager not to render.

What did work for me was passing flexDirection:'column-reverse' in as a prop

it looked like this;

<IndicatorViewPager style={{flexDirection: 'column-reverse', flex:1}} indicator={this._renderTitleIndicator()} >

skwidz avatar May 03 '18 19:05 skwidz

for

<IndicatorViewPager horizontalScroll={true} style={{flex: 1}} indicator={this._renderTabIndicator()} pagerStyle={{marginTop: 50}} onPageSelected={this.onPageSelected} trackScroll={true} ></IndicatorViewPager>

where

_renderTabIndicator() { return ( <PagerTitleIndicator style={ { flex: 1, height: 50, position: 'absolute', top: 0, left: 0, right: 0, backgroundColor: 'white' } } itemTextStyle={stylesd.indicatorText} selectedItemTextStyle={stylesd.indicatorSelectedText} titles={tabTitle} /> ); }

this will 100% show tab on top make sure you use

style={{flex: 1}} indicator={this._renderTabIndicator()}

it16madhavanadkat avatar Oct 11 '19 08:10 it16madhavanadkat