每个tab标签页的页面内容不可以是导入的组件吗
AnbolKing opened this issue · comments
AnbolKing commented
官方案例中TabView1, TabView2, TabView3这三个都是函数而且在同一个文件中,如果是使用导入的组件就无效,即使组件利用使用的是ScrollView
<View style={styles.container}>
<ScrollTabView headerHeight={headerHeight} renderScrollHeader={_renderScrollHeader}>
<HandAccount tabLabel="hand" />
<Like tabLabel="like" />
</ScrollTabView>
</View>
import HandAccount from './components/handaccount';
import Like from './components/like';
import React from 'react';
import { ScrollView, View, Text } from 'react-native';
const HandAccount = (props) => {
const data = new Array(2).fill({});
return (
{data.map((o, i) => (
<View style={{ marginVertical: 2, padding: 10, borderWidth: 1 }}>
{'tab3 => ' + i}
))}
);
}
export default HandAccount;
zyslife commented
@AnbolKing 我看到HandAccount没有使用ScrollView。 另外,如果能提供直接运行的demo更好
zyslife commented
@AnbolKing 问题解决了吗?我准备关掉这个了。