- Currently, the component in Weex only support the default green color, But many times the business needs to set color for the theme tone of the product, So needs to support setting the color.
- tintColor: Background color when the switch is turned on.
- onTintColor: Border color and background color on Android when the switch is turned off.
- thumbTintColor: Color of the foreground switch grip.
iOS | Web |
<switch on-tint-color="#C33D3E"
thumb-tint-color="#FF7703"
tint-color="#850B0B"
checked="true"></switch>
- Weex iOS:
- Weex Web:
- Weex Vue Demo:
It can be overwritten with the onTintColor
、thumbTintColor
、tintColor
attributes of switchView
, as well as the job of updating the attributes.
...
_switchView.onTintColor = _onTintColor;
_switchView.thumbTintColor = _thumbTintColor;
_switchView.tintColor = _tintColor;
Override the corresponding CSS styles.
Welcome to put forward any suggestion about the solution or other requirements for the component, Thanks!