Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to show page indicator top of the view #137

Open
ashanjayasundara opened this issue May 3, 2018 · 3 comments
Open

How to show page indicator top of the view #137

ashanjayasundara opened this issue May 3, 2018 · 3 comments

Comments

@ashanjayasundara
Copy link

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

@beeglebug
Copy link

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

@skwidz
Copy link

skwidz commented May 3, 2018

@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()} >

@it16madhavanadkat
Copy link

for

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

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()}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants