react-native-segmentedControl for( Android / Ios )
npm install react-native-segmented-controlFirst you need to install react-native-segmented-control:
``javascript`
npm install react-native-segmented-control --save
| prop | value | required/optional | comment |
| --- | --- | --- | --- |
| defaultPage | number | optional | default:0 |
| itemFontSize | number | optional | text fontsize default:14 |
| itemButtonActiveColor | color | optional | ActiveButton color |
| itemButtonColor | color | optional | defaultButton color |
| itemTextActiveColor | color | optional | ActiveText color |
| itemTextColor | color | optional | defaultText color |
| itemButtonViewStyle | style | optional | button container style |
| itemButtonBorderColor | color | optional | button border color |
| itemHeaderViewStyle | style | optional | header container style |
| prop | value | required/optional | comment |
| --- | --- | --- | --- |
| title | string | required | title of item |
| onPress | function | optional | the function will be called when item is selected. |
`javascript
import SegmentedControl from 'react-native-segmented-control';
itemButtonViewStyle = {{
width:200
}}
itemHeaderViewStyle = {{
paddingVertical:10,
}}
ref = {e=>this.SegmentedControl=e}
>
>
>
>
`
###Methods
* update(number) - select item.`javascript``
this.SegmentedControl.update(number)