Giter Site home page Giter Site logo

Comments (5)

zbtang avatar zbtang commented on May 29, 2024 3

Yes, you can.
Here is an example:

import React, {Component} from 'react';
import {StyleSheet, View,} from 'react-native';
import {IndicatorViewPager, PagerTitleIndicator} from 'rn-viewpager';

export default class TestPage extends Component {
    render() {
        return (
            <IndicatorViewPager
                style={{flex: 1}}
                indicator={this._renderTabIndicator()}
                pagerStyle={{marginTop: 50}}
            >
                <View style={{backgroundColor: 'red'}}/>
                <View style={{backgroundColor: 'blue'}}/>
                <View style={{backgroundColor: 'yellow'}}/>
            </IndicatorViewPager>
        );
    }

    _renderTabIndicator() {
        return (
            <PagerTitleIndicator
                style={styles.indicatorContainer}
                itemTextStyle={styles.indicatorText}
                selectedItemTextStyle={styles.indicatorSelectedText}
                titles={['red', 'blue', 'yellow']}
            />
        );
    }
}
const styles = StyleSheet.create({
    indicatorContainer: {
        height: 50,
        position: 'absolute',
        top: 0,
        left: 0,
        right: 0,
    },
    indicatorText: {color: 'green'},
    indicatorSelectedText: {
        color: 'orange'
    }
});

from react-native-viewpager.

akhileshsinha06 avatar akhileshsinha06 commented on May 29, 2024 2

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

from react-native-viewpager.

traderdata avatar traderdata commented on May 29, 2024 1

I tried your example and it worked but all tabs are aligned on left. Any way to have them eaqually spaced horizontally?

Thanks

from react-native-viewpager.

purushottamparajuli avatar purushottamparajuli commented on May 29, 2024

the navigation freezes when i impliment it like you said

from react-native-viewpager.

martin-braun avatar martin-braun commented on May 29, 2024

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

This looks cleaner, well done, love it

from react-native-viewpager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.