77
88import React from 'react' ;
99import { StyleSheet , ScrollView , Text , View } from 'react-native' ;
10- import SegmentedControlIOS from '@react-native-community/segmented-control' ;
10+ import SegmentedControl from '@react-native-community/segmented-control' ;
1111
1212export default class App extends React . Component < { } , $FlowFixMeState > {
1313 state = {
@@ -21,30 +21,28 @@ export default class App extends React.Component<{}, $FlowFixMeState> {
2121 < ScrollView contentContainerStyle = { styles . container } >
2222 < View style = { styles . segmentContainer } >
2323 < Text style = { styles . text } > Segmented controls can have values</ Text >
24- < SegmentedControlIOS values = { [ 'One' , 'Two' ] } />
24+ < SegmentedControl values = { [ 'One' , 'Two' ] } />
2525 </ View >
2626
2727 < View style = { styles . segmentSection } >
28- < SegmentedControlIOS
29- values = { [ 'One' , 'Two' , 'Three' , 'Four' , 'Five' ] }
30- />
28+ < SegmentedControl values = { [ 'One' , 'Two' , 'Three' , 'Four' , 'Five' ] } />
3129 </ View >
3230
3331 < View style = { styles . segmentSection } >
3432 < Text style = { styles . text } >
3533 Segmented controls can have pre-selected values
3634 </ Text >
37- < SegmentedControlIOS values = { [ 'One' , 'Two' ] } selectedIndex = { 0 } />
35+ < SegmentedControl values = { [ 'One' , 'Two' ] } selectedIndex = { 0 } />
3836 </ View >
3937
4038 < View style = { styles . segmentSection } >
4139 < Text style = { styles . text } > Segmented controls can be momentary</ Text >
42- < SegmentedControlIOS values = { [ 'One' , 'Two' ] } momentary = { true } />
40+ < SegmentedControl values = { [ 'One' , 'Two' ] } momentary = { true } />
4341 </ View >
4442
4543 < View style = { styles . segmentSection } >
4644 < Text style = { styles . text } > Segmented controls can be disabled</ Text >
47- < SegmentedControlIOS
45+ < SegmentedControl
4846 enabled = { false }
4947 values = { [ 'One' , 'Two' ] }
5048 selectedIndex = { 1 }
@@ -53,22 +51,24 @@ export default class App extends React.Component<{}, $FlowFixMeState> {
5351
5452 < View style = { styles . segmentContainer } >
5553 < Text style = { styles . text } > Custom colors can be provided</ Text >
56- < SegmentedControlIOS
54+ < SegmentedControl
5755 tintColor = "#ff0000"
5856 values = { [ 'One' , 'Two' , 'Three' , 'Four' ] }
5957 selectedIndex = { 0 }
6058 backgroundColor = "#0000ff"
59+ activeTextColor = "white"
6160 />
6261 </ View >
6362 < View style = { styles . segmentContainer } >
64- < SegmentedControlIOS
63+ < SegmentedControl
6564 tintColor = "#00ff00"
6665 values = { [ 'One' , 'Two' , 'Three' ] }
6766 selectedIndex = { 1 }
67+ activeTextColor = "black"
6868 />
6969 </ View >
7070 < View style = { styles . segmentSection } >
71- < SegmentedControlIOS
71+ < SegmentedControl
7272 textColor = "#ff00ff"
7373 values = { [ 'One' , 'Two' ] }
7474 selectedIndex = { 1 }
@@ -78,7 +78,7 @@ export default class App extends React.Component<{}, $FlowFixMeState> {
7878 < View >
7979 < Text style = { styles . text } > Custom colors can be provided</ Text >
8080 < View style = { styles . segmentContainer } >
81- < SegmentedControlIOS
81+ < SegmentedControl
8282 values = { this . state . values }
8383 selectedIndex = { this . state . selectedIndex }
8484 onChange = { this . _onChange }
0 commit comments