mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-06-17 07:39:17 +08:00
New Handling Touches Tutorial
Summary: Finally, a place where `Button` is properly introduced. This is based on the old Handling Touches guide, which has been simplified (with some content moved over to the scroll views tutorial). I've also updated the ordering of the guides into something that makes more sense to someone just getting started with React Native. Closes https://github.com/facebook/react-native/pull/14371 Differential Revision: D5201127 Pulled By: hramos fbshipit-source-id: 819192e2db9febb8a315f51693dae557752b6002
This commit is contained in:
committed by
Facebook Github Bot
parent
81c2f3b189
commit
f42f2dff37
@@ -5,10 +5,10 @@ layout: docs
|
||||
category: The Basics
|
||||
permalink: docs/using-a-scrollview.html
|
||||
next: using-a-listview
|
||||
previous: handling-text-input
|
||||
previous: handling-touches
|
||||
---
|
||||
|
||||
The [`ScrollView`](docs/scrollview.html) is a generic scrolling container that can host multiple components and views. The scrollable items need not be homogenous, and you can scroll both vertically and horizontally (by setting the `horizontal` property).
|
||||
The [ScrollView](docs/scrollview.html) is a generic scrolling container that can host multiple components and views. The scrollable items need not be homogenous, and you can scroll both vertically and horizontally (by setting the `horizontal` property).
|
||||
|
||||
This example creates a vertical `ScrollView` with both images and text mixed together.
|
||||
|
||||
@@ -62,4 +62,8 @@ AppRegistry.registerComponent(
|
||||
() => IScrolledDownAndWhatHappenedNextShockedMe);
|
||||
```
|
||||
|
||||
`ScrollView` works best to present a small amount of things of a limited size. All the elements and views of a `ScrollView` are rendered, even if they are not currently shown on the screen. If you have a long list of more items that can fit on the screen, you should use a `FlatList` instead. So let's [learn about list views](docs/using-a-listview.html) next.
|
||||
ScrollViews can be configured to allow paging through views using swiping gestures by using the `pagingEnabled` props. Swiping horizontally between views can also be implemented on Android using the [ViewPagerAndroid](docs/viewpagerandroid.html) component.
|
||||
|
||||
A ScrollView with a single item can be used to allow the user to zoom content. Set up the `maximumZoomScale` and `minimumZoomScale` props and your user will be able to use pinch and expand gestures to zoom in and out.
|
||||
|
||||
The ScrollView works best to present a small amount of things of a limited size. All the elements and views of a `ScrollView` are rendered, even if they are not currently shown on the screen. If you have a long list of more items that can fit on the screen, you should use a `FlatList` instead. So let's [learn about list views](docs/using-a-listview.html) next.
|
||||
|
||||
Reference in New Issue
Block a user