-
Notifications
You must be signed in to change notification settings - Fork 179
Expand file tree
/
Copy pathExample8.js
More file actions
55 lines (48 loc) · 1.54 KB
/
Example8.js
File metadata and controls
55 lines (48 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import React from 'react'
import { Button, View } from 'react-native'
import TableView from 'react-native-tableview'
const { Section, Item } = TableView
class Example8 extends React.Component{
render() {
return(
<View style={{ flex: 1 }}>
<Button title="Scroll To Section 2" onPress={() => this.tableView.scrollToIndex({index: 2, section: 1})} />
<TableView
style={{ flex: 1 }}
allowsToggle
ref={ref => this.tableView = ref}
allowsMultipleSelection
tableViewStyle={TableView.Consts.Style.Grouped}
tableViewCellStyle={TableView.Consts.CellStyle.Subtitle}
onPress={event => console.log(event)}
>
<Section label="Section 1" arrow>
<Item value="1" detail="Detail1">
Item 1
</Item>
<Item value="2">Item 2</Item>
<Item>Item 3</Item>
</Section>
<Section label="Section 2" arrow={false}>
<Item>Item 1</Item>
<Item>Item 2</Item>
<Item>Item 3</Item>
</Section>
<Section label="Section 3" arrow={false}>
<Item>Item 1</Item>
<Item>Item 2</Item>
<Item>Item 3</Item>
<Item>Item 4</Item>
<Item>Item 5</Item>
<Item>Item 6</Item>
<Item>Item 7</Item>
<Item>Item 8</Item>
<Item>Item 9</Item>
<Item>Item 10</Item>
</Section>
</TableView>
</View>
)
}
}
export default Example8