【问题标题】:Create a horizontal list to select age创建水平列表以选择年龄
【发布时间】:2021-09-01 18:46:47
【问题描述】:

我正在尝试构建类似这样的东西

我在 React Native 中做,你会推荐我用什么来创建这样的列表,我可以增加焦点数?

【问题讨论】:

  • 寻找 react 原生轮播库。

标签: react-native react-native-ios react-native-flatlist


【解决方案1】:

这是您想要的简单版本。

const App = () => {

const ages = new Array(100).fill(0);

return <FlatList
 data={ages}
 horizontal
 renderItem={({index}) => <View style={{marginHorizontal: 10}}><Text>{index + 1}</Text></View>}
/>

}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-01-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多