非常教程

React native参考手册

Components: VirtualizedList

VirtualizedList

为更方便的组件<FlatList><SectionList>组件提供基础实现,这些组件也有更好的记录。一般来说,只有在需要比FlatList提供更多的灵活性时才应该使用它,例如用于不可变数据而不是普通数组。

虚拟化通过维护活动项目的有限渲染窗口并用适当大小的空白空间替换渲染窗口之外的所有项目,大大提高了内存消耗和大型列表的性能。窗口适应滚动行为,如果项目距离可见区域较远,或者使用hi-pri以最小化看到空白区域的可能性,则项目以低pri(在任何正在运行的交互之后)递增呈现。

Some caveats:

  • 当内容滚出渲染窗口时内部状态不会保留。确保所有数据都在项目数据或外部商店(如Flux,Redux或Relay)中捕获。
  • PureComponent意味着如果props保持浅浅平等,它不会重新渲染。确保你的renderItem函数所依赖的所有东西都作为一个道具(eg extraData)传递,而不是===在更新之后传递,否则你的UI可能不会在更改时更新。这包括dataprop和父组件状态。
  • 为了约束内存并启用平滑滚动,内容将异步呈现在屏幕外。这意味着可以以比填充率更快的速度滚动,并立即看到空白内容。这是一种权衡,可以根据每个应用程序的需要进行调整,并且我们正在努力在幕后改进它。
  • 默认情况下,列表key在每个项目上查找一个道具并将其用于React键。或者,您可以提供自定义keyExtractor道具。

道具

disableVirtualization?:

first: number

horizontal?:

initialNumToRender?:

keyExtractor?:

last: number

maxToRenderPerBatch?:

onEndReachedThreshold?:

scrollEventThrottle?:

updateCellsBatchingPeriod?:

windowSize?:

方法

scrollToEnd(params?: object)

scrollToIndex(params: object)

scrollToItem(params: object)

scrollToOffset(params: object)

滚动到列表中的特定内容像素偏移量。

Param offset期望偏移量滚动到。如果horizontal是,则偏移量是x值,在任何其他情况下偏移量都是y值。

Param animatedtrue默认)定义列表是否应在滚动时执行动画。

recordInteraction()

flashScrollIndicators()

类型定义

道具

类型:

IntersectionTypeAnnotation

Components: VirtualizedList相关

React native

React Native 是一个 JavaScript 的框架,用来撰写实时的、可原生呈现 iOS 和 Android 的应用。

主页 https://facebook.github.io/react-native/
源码 https://github.com/facebook/react-native
发布版本 0.49

React native目录

1.开始 | Getting Started
2.指南 | Guides
3.APIs
4.组件:ActivityIndicator | Components: ActivityIndicator
5.组件:按钮 | Components: Button
6.组件:CheckBox | Components: CheckBox
7.组件:DatePickerIOS | Components: DatePickerIOS
8.组件:DrawerLayoutAndroid | Components: DrawerLayoutAndroid
9.组件:FlatList | Components: FlatList
10.组件:图像 | Components: Image
11.组件:KeyboardAvoidingView | Components: KeyboardAvoidingView
12.Components: ListView
13.Components: MaskedViewIOS
14.Components: Modal
15.Components: NavigatorIOS
16.Components: Picker
17.Components: PickerIOS
18.Components: ProgressBarAndroid
19.Components: ProgressViewIOS
20.Components: RefreshControl
21.Components: ScrollView
22.Components: SectionList
23.Components: SegmentedControlIOS
24.Components: Slider
25.Components: SnapshotViewIOS
26.Components: StatusBar
27.Components: Switch
28.Components: TabBarIOS
29.Components: TabBarIOS.Item
30.Components: Text
31.Components: TextInput
32.Components: ToolbarAndroid
33.Components: TouchableHighlight
34.Components: TouchableNativeFeedback
35.Components: TouchableOpacity
36.Components: TouchableWithoutFeedback
37.Components: View
38.Components: ViewPagerAndroid
39.Components: VirtualizedList
40.Components: WebView
41.创建 | Contributing
42.指南(Android) | Guides (Android)
43.指南(IOS) | Guides (iOS)
44.其他 | Miscellaneous