【问题标题】:react native paper list accordion反应原生纸列表手风琴
【发布时间】:2020-11-27 23:46:19
【问题描述】:

我在使用 react-native 纸质列表手风琴时遇到问题,它无法在 android 上运行!我的意思是列表正在显示,但当您单击手风琴时不会显示:(。在 ios 上一切正常!关于如何解决这个问题的任何想法:( thx

我在 sumsung 上使用最新的 android 版本

<List.Accordion
    key={id}
    theme={{ colors: { primary: '#4169e1' } }}
    style={{ backgroundColor: 'white', marginBottom: 1 }}
    onPress={() => { LayoutAnimation.easeInEaseOut(); }}
    title={title}>
    <Divider />
    <List.Item
        titleStyle={styles.textContainer}
        title={
            <View>
                <Text style={styles.text}>{text}</Text>
            </View>
        } key={index} />
</List.Accordion>

【问题讨论】:

  • 尝试删除 并将其添加到列表项视图
  • 您的代码对我有用,所以我只能猜测问题出在其他地方。

标签: android reactjs react-native react-native-paper


【解决方案1】:

您需要将 项目放入

<List.AccordionGroup title={title} key={id}>
    <List.Accordion
        key={id}
        theme={{ colors: { primary: '#4169e1' } }}
        style={{ backgroundColor: 'white', marginBottom: 1 }}
        onPress={() => { LayoutAnimation.easeInEaseOut(); }}
        title={title}>
        <Divider />
        <List.Item
            titleStyle={styles.textContainer}
            title={
                <View>
                    <Text style={styles.text}>{text}</Text>
                </View>
            } key={index} />
     </List.Accordion>
</List.AccordionGroup>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-08-19
    • 2023-01-23
    • 1970-01-01
    • 2017-10-26
    • 1970-01-01
    • 1970-01-01
    • 2020-12-18
    • 1970-01-01
    相关资源
    最近更新 更多