/** * 自定义Switch组件 * @邠心vbe on 2023/08/30 */ import React from 'react'; import { Switch } from 'react-native'; import utils from '../utils/utils'; //const switchStyle = { false: "#B2B2B2", true: colorAccent }; export default SwitchBase = (props) => { const colors = utils.hexColorToRgb(colorAccent); var thumbColor = null; var trackColor = { false: "#B2B2B2", true: colorAccent } if (!isIOS) { thumbColor = (props.value ? utils.getRgbaColor(colors, 0.9) : "#EBEDEC") trackColor = {false: "#B2B2B2", true: utils.getRgbaColor(colors, 0.3)} } return ( ); }