Skip to content

Render a ViewPagerAndroid in ListView.renderHeader() that the elements under ViewPagerAndroid will not display #4455

Closed
@charmingzuo

Description

@charmingzuo
let React = require('react-native');

let {
    Text,
    View,
    Image,
    ListView,
    TouchableHighlight,
    Component,
    ViewPagerAndroid,
    AppRegistry,
    } = React;

class Main extends Component {
    constructor(props) {
        super(props);
        let ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});
        this.state = {
            dataSource: ds.cloneWithRows(new Array(30).join(' ').split(' ').map((s, i)=>`this is item ${i}`)),
        };
    }

    render() {
        return (
            <View style={{flex: 1}}>
                <ListView
                    dataSource={this.state.dataSource}
                    renderHeader={()=>{
                        return (
                            <ViewPagerAndroid style={{height: 150, backgroundColor: 'lightgreen'}}>

                                {/* ---- missed these things ---- */}
                                <View style={{height: 150, backgroundColor: 'red'}}>
                                    <Text>the View object is ok</Text>
                                </View>

                            </ViewPagerAndroid>
                        );
                    }}
                    renderRow={(d) => {
                        return (
                            <Text style={{textAlign: 'center'}}>{d}</Text>
                        )
                    }}
                />
            </View>
        )
    }
}

AppRegistry.registerComponent('tmp', () => Main);

bug

Activity

changed the title [-]I got a bugUse both ListView & ViewPagerAndroid [/-] [+]Use both ListView & ViewPagerAndroid that the elements under ViewPagerAndroid will not display[/+] on Dec 1, 2015
changed the title [-]Use both ListView & ViewPagerAndroid that the elements under ViewPagerAndroid will not display[/-] [+]Render a ViewPagerAndroid in ListView.renderHeader() that the elements under ViewPagerAndroid will not display[/+] on Dec 1, 2015
facebook-github-bot

facebook-github-bot commented on Dec 1, 2015

@facebook-github-bot
Contributor

Hey charmingzuo, thanks for reporting this issue!

React Native, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.

  • If this is a feature request or a bug that you would like to be fixed by the team, please report it on Product Pains. It has a ranking feature that lets us focus on the most important issues the community is experiencing.
  • If you don't know how to do something or not sure whether some behavior is expected or a bug, please ask on StackOverflow with the tag react-native or for more real time interactions, ask on Discord in the #react-native channel.
  • We welcome clear issues and PRs that are ready for in-depth discussion; thank you for your contributions!
charmingzuo

charmingzuo commented on Dec 1, 2015

@charmingzuo
Author

I'm using react-native@0.15.0

mc-zone

mc-zone commented on Dec 10, 2015

@mc-zone

+1. had same issue.

charmingzuo

charmingzuo commented on Jan 5, 2016

@charmingzuo
Author

@mc-zone 有解决方案了吗?

mkonicek

mkonicek commented on Apr 10, 2016

@mkonicek
Contributor

Hi there! This issue is being closed because it has been inactive for a while.

But don't worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/render-a-viewpagerandroid-in-listviewrenderheader-that-the-elements-under-viewpagerandroid-will-not-display

ProductPains helps the community prioritize the most important issues thanks to its voting feature.
It is easy to use - just login with GitHub.

Also, if this issue is a bug, please consider sending a PR with a fix.
We're a small team and rely on the community for bug fixes of issues that don't affect fb apps.

mrharel

mrharel commented on May 5, 2016

@mrharel

so this bug is not going to be fixed? how can we overcome it?

animabear

animabear commented on Nov 12, 2016

@animabear

+1

Jiasm

Jiasm commented on Mar 1, 2017

@Jiasm

+1
waiting for resolve

locked as resolved and limited conversation to collaborators on Jul 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @mkonicek@mrharel@charmingzuo@animabear@mc-zone

        Issue actions

          Render a ViewPagerAndroid in ListView.renderHeader() that the elements under ViewPagerAndroid will not display · Issue #4455 · facebook/react-native