react-native-segmentedControl for( Android / Ios )
SegmentedControl using react-native,support android and ios. Pages won't be rendered when you switch to other tabs,also save the status of invisible pages.
First you need to install react-native-segmented-control:
npminstallreact-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. |
importSegmentedControlfrom'react-native-segmented-control';<SegmentedControldefaultPage={1}itemButtonViewStyle={{width:200}}itemHeaderViewStyle={{paddingVertical:10,}}ref={e=>this.SegmentedControl=e}><SegmentedControl.Itemtitle={'直播'}><View>page0</View></SegmentedControl.Item><SegmentedControl.Itemtitle={'点播'}><View>page1</View></SegmentedControl.Item><SegmentedControl.Itemtitle={'影音'}><View>page2</View></SegmentedControl.Item></SegmentedControl>###Methods
update(number)- select item.
this.SegmentedControl.update(number)


