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

How about support a scrollable pager title indicator?

Open anAngryAnt opened this issue 8 years ago • 3 comments

scrollable pager title indicator is necessary as a popular lib , and there are lots of actual scene need it as follow:

ezgif-4-50d105e9a3

anAngryAnt avatar Nov 05 '17 05:11 anAngryAnt

更新后,title数量少的情况下,无法撑满界面

neilzhengzx avatar Nov 17 '17 02:11 neilzhengzx

@neilzhengzx 确实有这样的需求,过两天会抽空修复它 :)

anAngryAnt avatar Nov 21 '17 01:11 anAngryAnt

@neilzhengzx 现在你可以通过

<PagerTitleIndicator
                style={styles.indicatorContainer}
                trackScroll={true}
                itemTextStyle={styles.indicatorText}
                itemStyle={{width:windowWidth/4}}
                selectedItemStyle={{width:windowWidth/4}}
                selectedItemTextStyle={styles.indicatorSelectedText}
                selectedBorderStyle={styles.selectedBorderStyle}
                titles={['SQUARE', 'CIRCLE','TRIANGLE','SQUARE', 'CIRCLE','TRIANGLE','SQUARE', 'CIRCLE','TRIANGLE']}
            />

指定itemStyle和selectedItemStyle的方式,来控制tabItem的宽,来达到你想要的撑满界面的效果了

anAngryAnt avatar Nov 26 '17 08:11 anAngryAnt