@@ -25,13 +25,13 @@ npm install --save @react-native-community/segmented-control
2525This 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:
2626
2727``` javascript
28- import { SegmentedControlIOS } from " react-native" ;
28+ import {SegmentedControlIOS } from ' react-native' ;
2929```
3030
3131to:
3232
3333``` javascript
34- import SegmentedControlIOS from " @react-native-community/segmented-control" ;
34+ import SegmentedControlIOS from ' @react-native-community/segmented-control' ;
3535```
3636
3737## Usage
@@ -48,14 +48,14 @@ Note that the state variable would need to be updated as the user
4848selects a value and changes the index, as shown in the example below.
4949
5050``` javascript
51- import SegmentedControlIOS from " @react-native-community/segmented-control" ;
51+ import SegmentedControlIOS from ' @react-native-community/segmented-control' ;
5252
5353return (
5454 < SegmentedControlIOS
55- values= {[" One" , " Two" ]}
55+ values= {[' One' , ' Two' ]}
5656 selectedIndex= {this .state .selectedIndex }
5757 onChange= {event => {
58- this .setState ({ selectedIndex: event .nativeEvent .selectedSegmentIndex });
58+ this .setState ({selectedIndex: event .nativeEvent .selectedSegmentIndex });
5959 }}
6060 / >
6161);
@@ -89,6 +89,16 @@ type SegmentedControlIOSProps = $ReadOnly<{|
8989 * Accent color of the control.
9090 */
9191 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,
92102 /**
93103 * If true, then selecting a segment won't persist visually.
94104 * The `onValueChange` callback will still work as expected.
@@ -100,6 +110,7 @@ type SegmentedControlIOSProps = $ReadOnly<{|
100110## Maintainers
101111
102112- [M.Haris Baig](https://github.com/harisbaig100)
113+ - [Naturalclar](https://github.com/Naturalclar)
103114
104115## Contributing
105116
@@ -109,7 +120,7 @@ Please see the [`contributing guide`](/CONTRIBUTING.md).
109120
110121The library is released under the MIT licence. For more information see [` LICENSE ` ](/LICENSE).
111122
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
114125[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