ListView horizontal = {true} 中断应用程序并出现应用程序注册表错误
ListView horizontal = {true} breaks application with app registry error
我得到的错误是:"Application PRSNT_prototype has not been registered"
我项目的文件夹名称是 PRSNT_demo,这些是我认为可能是问题的代码:
AppRegistry.registerComponent('PRSNT_demo', () => Main);
<ListView
horizontal={true}
dataSource={this.state.dataSource}
renderRow={(rowData) => <View>{rowData}</View>}
/>
每当我在应用程序上打开 horizontal={true} 时就会中断。 我试过打开和关闭应用程序,还试过:
<ListView
style={Style.horList}
dataSource={this.state.dataSource}
renderRow={(rowData) => <View>{rowData}</View>}
/>
style.horlist 为:
horList: {
flexDirection: 'row',
},
这也破坏了应用程序。
如果有人能帮助我,那就太好了,非常感谢
我通过将 ListView 设为 ScrollView 解决了这个问题,效果很好:
<ScrollView showsHorizontalScrollIndicator={false} horizontal={true}>
<Text>Item 1</Text>
<Text>Item 2</Text>
<Text>Item 3</Text>
<Text>Item 4</Text>
</ScrollView>
我得到的错误是:"Application PRSNT_prototype has not been registered"
我项目的文件夹名称是 PRSNT_demo,这些是我认为可能是问题的代码:
AppRegistry.registerComponent('PRSNT_demo', () => Main);
<ListView
horizontal={true}
dataSource={this.state.dataSource}
renderRow={(rowData) => <View>{rowData}</View>}
/>
每当我在应用程序上打开 horizontal={true} 时就会中断。 我试过打开和关闭应用程序,还试过:
<ListView
style={Style.horList}
dataSource={this.state.dataSource}
renderRow={(rowData) => <View>{rowData}</View>}
/>
style.horlist 为:
horList: {
flexDirection: 'row',
},
这也破坏了应用程序。
如果有人能帮助我,那就太好了,非常感谢
我通过将 ListView 设为 ScrollView 解决了这个问题,效果很好:
<ScrollView showsHorizontalScrollIndicator={false} horizontal={true}>
<Text>Item 1</Text>
<Text>Item 2</Text>
<Text>Item 3</Text>
<Text>Item 4</Text>
</ScrollView>