@@ -5,53 +5,48 @@ export function ExampleTabs() {
5
5
const [ selectedIndex , setSelectedIndex ] = React . useState ( 0 ) ;
6
6
7
7
return (
8
- < tabs
9
- selectedIndex = { selectedIndex }
10
- onSelectedIndexChanged = { ( args ) => {
11
- console . log ( ' onSelectedIndexChanged' , args ) ;
12
- // setSelectedIndex(args.newIndex);
13
- } }
14
- style = { { ...styles . fullSize } }
15
- >
16
- { /* The bottomTab UI is created via tabStrip (the container) and tabStripItem (for each tab) */ }
17
- < tabStrip nodeRole = "tabStrip" >
18
- < tabStripItem >
19
- < label nodeRole = "label" > Home</ label >
20
- < image nodeRole = "image" src = "font://" className = "fas" />
21
- </ tabStripItem >
22
- < tabStripItem className = "special" >
23
- < label nodeRole = "label" > Account</ label >
24
- < image nodeRole = "image" src = "font://" className = "fas" />
25
- </ tabStripItem >
26
- < tabStripItem className = "special" >
27
- < label nodeRole = "label" > Search</ label >
28
- < image nodeRole = "image" src = "font://" className = "fas" />
29
- </ tabStripItem >
30
- </ tabStrip >
8
+ < page style = { { backgroundColor : 'yellow' } } >
9
+ < tabs
10
+ selectedIndex = { selectedIndex }
11
+ onSelectedIndexChanged = { ( args ) => {
12
+ setSelectedIndex ( args . newIndex ) ;
13
+ } }
14
+ style = { { ...styles . fullSize , backgroundColor : 'orange' } }
15
+ >
16
+ { /* The bottomTab UI is created via tabStrip (the container) and tabStripItem (for each tab) */ }
17
+ < tabStrip nodeRole = "tabStrip" style = { { backgroundColor : 'red' } } >
18
+ < tabStripItem nodeRole = "items" >
19
+ < label nodeRole = "label" > Home</ label >
20
+ < image nodeRole = "image" src = "font://" className = "fas" />
21
+ </ tabStripItem >
22
+ < tabStripItem nodeRole = "items" className = "special" >
23
+ < label nodeRole = "label" > Account</ label >
24
+ < image nodeRole = "image" src = "font://" className = "fas" />
25
+ </ tabStripItem >
26
+ < tabStripItem nodeRole = "items" className = "special" >
27
+ < label nodeRole = "label" > Search</ label >
28
+ < image nodeRole = "image" src = "font://" className = "fas" />
29
+ </ tabStripItem >
30
+ </ tabStrip >
31
31
32
- { /* The number of tabContentItem components should corespond to the number of TabStripItem components */ }
33
- < tabContentItem nodeRole = "items" >
34
- < gridLayout >
35
- < label nodeRole = "label" className = "h2 text-center" >
36
- Home Page
37
- </ label >
38
- </ gridLayout >
39
- </ tabContentItem >
40
- < tabContentItem nodeRole = "items" >
41
- < gridLayout >
42
- < label nodeRole = "label" className = "h2 text-center" >
43
- Account Page
44
- </ label >
45
- </ gridLayout >
46
- </ tabContentItem >
47
- < tabContentItem nodeRole = "items" >
48
- < gridLayout >
49
- < label nodeRole = "label" className = "h2 text-center" >
50
- Search Page
51
- </ label >
52
- </ gridLayout >
53
- </ tabContentItem >
54
- </ tabs >
32
+ { /* The number of tabContentItem components should corespond to the number of TabStripItem components */ }
33
+ < tabContentItem nodeRole = "items" >
34
+ < gridLayout nodeRole = "content" style = { { ...styles . fullSize , backgroundColor : 'blue' } } >
35
+ < label style = { { color : 'white' } } > Home Page</ label >
36
+ </ gridLayout >
37
+ </ tabContentItem >
38
+ < tabContentItem nodeRole = "items" >
39
+ < gridLayout nodeRole = "content" style = { { ...styles . fullSize , backgroundColor : 'cyan' } } >
40
+ < label style = { { color : 'black' } } > Account Page</ label >
41
+ </ gridLayout >
42
+ </ tabContentItem >
43
+ < tabContentItem nodeRole = "items" >
44
+ < gridLayout nodeRole = "content" style = { { ...styles . fullSize , backgroundColor : 'magenta' } } >
45
+ < label style = { { color : 'black' } } > Search Page</ label >
46
+ </ gridLayout >
47
+ </ tabContentItem >
48
+ </ tabs >
49
+ </ page >
55
50
) ;
56
51
}
57
52
0 commit comments