react-native-collapse-view
react-native-collapse-view copied to clipboard
First all Items are open, then they collapse
If I open the Screen with your component, all Text is visible. Aftter some seconds, each item get collapsed:
What is the way to prevent showing collapsing at first load... instead only the headlines should appear. Is there a kind of flag or event which is fired, if all items are fully loaded and collapsed?
Here my code:
_renderIconView = (data) => (collapse) => {
const answer = <Text style={styles.headerText} >{data.frage}</Text >;
return (
<View style={styles.iconView} >
<View >
{
collapse ?
<Icon name='chevron-down' type='Feather' color={cfg.fontLight} > {answer}</Icon > :
<Icon name='chevron-right' type='Feather' color={cfg.fontLight} > {answer}</Icon >
}
</View >
</View >
)
}
_renderCollapseView = (data) => (collapse) => {
console.log("collapes",collapse);
return (
<View style={styles.content} >
<HTML html={data.antwort.replace(/\r?\n/g, " ")}
baseFontStyle={fontStyles}
tagsStyles={tagStyles}
onLinkPress={(event, href) => {
Linking.openURL(ParseUrl(href)).catch(e => console.log("Fehler beim Aufruf der url: " + href, e));
}}
/>
</View >
)
}
render() {
console.log("ich render");
return (
<View style={styles.faqWrapper} >
{this.props.faq.map((data, index) => {
return <CollapseView
key={index}
tension={10}
renderView={this._renderIconView(data)}
renderCollapseView={this._renderCollapseView(data)}
/>
})
}
</View >
);
};
}
I figured out... that slow is it only at debug-build. But on Release-Build you also see a small delay and flickering on startup
I see the same results. Much less noticeable in production. Lag seems to increase with the number of items on the screen.
yes you are right when i putes countries names as items , it become more slowly and it don't show them all. there any other solution to fix that ?