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

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

Closed
charmingzuo opened this issue Dec 1, 2015 · 8 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@charmingzuo
Copy link

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

@charmingzuo charmingzuo changed the title I got a bugUse both ListView & ViewPagerAndroid Use both ListView & ViewPagerAndroid that the elements under ViewPagerAndroid will not display Dec 1, 2015
@charmingzuo charmingzuo 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 Dec 1, 2015
@facebook-github-bot
Copy link
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
Copy link
Author

I'm using react-native@0.15.0

@mc-zone
Copy link

mc-zone commented Dec 10, 2015

+1. had same issue.

@charmingzuo
Copy link
Author

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

@mkonicek
Copy link
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
Copy link

mrharel commented May 5, 2016

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

@animabear
Copy link

+1

@Jiasm
Copy link

Jiasm commented Mar 1, 2017

+1
waiting for resolve

@facebook facebook locked as resolved and limited conversation to collaborators Jul 20, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

8 participants