2

How to create dropdown menu using react-native?

How to show/hide content?

4

1 回答 1

2

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>
    );
}
于 2015-12-23T12:01:07.903 回答