如何使用react-native创建下拉菜单?
如何显示/隐藏内容?
最佳答案
https://github.com/alinz/react-native-dropdown
这将为您提供与您要求的类似的下拉菜单。显示/隐藏内容只是决定渲染或不渲染内容,可以通过多种方式完成。
render() {
let hideableContent;
if (this.state.shouldRenderContent) {
hideableContent = <Text>I AM SHOWING</Text>;
}
return (
<View>
<Text>This doesn't hide</Text>
{hideableContent}
</View>
);
}
关于javascript - 如何使用react-native显示/隐藏内容?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34434520/