@@ -25,13 +25,13 @@ npm install --save @react-native-community/segmented-control
25
25
This module was created when the segmentedControlIos was split out from the core of React Native. To migrate to this module you need to follow the installation instructions above and then change you imports from:
26
26
27
27
``` javascript
28
- import { SegmentedControlIOS } from " react-native" ;
28
+ import {SegmentedControlIOS } from ' react-native' ;
29
29
```
30
30
31
31
to:
32
32
33
33
``` javascript
34
- import SegmentedControlIOS from " @react-native-community/segmented-control" ;
34
+ import SegmentedControlIOS from ' @react-native-community/segmented-control' ;
35
35
```
36
36
37
37
## Usage
@@ -48,14 +48,14 @@ Note that the state variable would need to be updated as the user
48
48
selects a value and changes the index, as shown in the example below.
49
49
50
50
``` javascript
51
- import SegmentedControlIOS from " @react-native-community/segmented-control" ;
51
+ import SegmentedControlIOS from ' @react-native-community/segmented-control' ;
52
52
53
53
return (
54
54
< SegmentedControlIOS
55
- values= {[" One" , " Two" ]}
55
+ values= {[' One' , ' Two' ]}
56
56
selectedIndex= {this .state .selectedIndex }
57
57
onChange= {event => {
58
- this .setState ({ selectedIndex: event .nativeEvent .selectedSegmentIndex });
58
+ this .setState ({selectedIndex: event .nativeEvent .selectedSegmentIndex });
59
59
}}
60
60
/ >
61
61
);
@@ -89,6 +89,16 @@ type SegmentedControlIOSProps = $ReadOnly<{|
89
89
* Accent color of the control.
90
90
*/
91
91
tintColor?: ? string,
92
+ /**
93
+ * (For iOS >= 13)
94
+ * Text color of the control.
95
+ */
96
+ textColor?: ? string,
97
+ /**
98
+ * (For iOS >= 13)
99
+ * Background color of the control.
100
+ */
101
+ backgroundColor?: ? string,
92
102
/**
93
103
* If true, then selecting a segment won't persist visually.
94
104
* The `onValueChange` callback will still work as expected.
@@ -100,6 +110,7 @@ type SegmentedControlIOSProps = $ReadOnly<{|
100
110
## Maintainers
101
111
102
112
- [M.Haris Baig](https://github.com/harisbaig100)
113
+ - [Naturalclar](https://github.com/Naturalclar)
103
114
104
115
## Contributing
105
116
@@ -109,7 +120,7 @@ Please see the [`contributing guide`](/CONTRIBUTING.md).
109
120
110
121
The library is released under the MIT licence. For more information see [` LICENSE ` ](/LICENSE).
111
122
112
- [circle-ci-badge]:https://img.shields.io/circleci/project/github/react-native-community/react-native-segmented-control/master.svg?style=flat-square
113
- [npm-badge]:https://img.shields.io/npm/v/@react-native-community/segmented-control.svg?style=flat-square
123
+ [circle-ci-badge]: https://img.shields.io/circleci/project/github/react-native-community/react-native-segmented-control/master.svg?style=flat-square
124
+ [npm-badge]: https://img.shields.io/npm/v/@react-native-community/segmented-control.svg?style=flat-square
114
125
[lean-core-badge]: https://img.shields.io/badge/Lean%20Core-Extracted-brightgreen.svg?style=flat-square
115
- [lean-core-issue]: https://github.com/facebook/react-native/issues/23313
126
+ [lean-core-issue]: https://github.com/facebook/react-native/issues/23313
0 commit comments