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

can not scroll the page when the content exceeds the width of the screen #28

Open
syarifurqon opened this issue Dec 12, 2016 · 0 comments

Comments

@syarifurqon
Copy link

syarifurqon commented Dec 12, 2016

i have image. when my screen on landscape, screen can not scroll. while adding image becomes wide.

this is my code

const { width, height } = Dimensions.get('window')

const styles = {
image: {
width:null,

alignSelf: 'stretch',
flex: 1

}
}

import {PagerTabIndicator, IndicatorViewPager, PagerTitleIndicator, PagerDotIndicator} from 'rn-viewpager';

export default class ViewPagerPage extends Component {
render() {

    var _scrollView: ScrollView;

    return (
        <View style={{flex:1}}>
            <IndicatorViewPager
                style={{flex:1}}
                indicator={this._renderDotIndicator()}
            >
                <View style={{backgroundColor:'cadetblue'}}>
                    <Text>page one</Text>
                </View>
                <View style={{backgroundColor:'cornflowerblue', flex:1}}>
                    <ScrollView
                      pagingEnabled = {true}
                    >
                    <Image style={styles.image} source={require('./img/2.jpg')} /> // **<-- this is my question**
                    </ScrollView>
                </View>
                <View style={{backgroundColor:'#1AA094'}}>
                    <Text>page three</Text>
                </View>
            </IndicatorViewPager>


        </View>
    );
}


_renderDotIndicator() {
    return <PagerDotIndicator pageCount={3} />;
}

}

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

1 participant