Кнопка React Native Pepper Switch не работает на Android, но работает нормально в браузере & IOS - PullRequest
0 голосов
/ 08 марта 2020

React Native Pepper Switch Button не работает на Android, но работает нормально в браузере и IOS.

не знаю, что мне не хватает. я тоже добавляю скриншот

http://prntscr.com/rdczsw пожалуйста, посмотрите и дайте мне то, что мне не хватает

import React from "react";
import { StyleSheet, Text, View } from "react-native";
import { Switch } from "react-native-paper";
import { theme } from "../core/theme";

class Customswitch extends React.Component{
  constructor(){
    super();
    this.state = {
      isSwitchOn: false,
    };
  }
  render() {
    return (
      <View style={styles.container}>
        <View style={styles.containerLeft}>
          <Text style={styles.featureheader}>{this.props.contentText}</Text>
        </View>
        <View style={styles.containerRight}>
        <Switch value={this.state.isSwitchOn} onValueChange={() =>
          { console.log('data changed'); this.setState({ isSwitchOn: !this.state.isSwitchOn }); this.props.activateCallLog(this.state.isSwitchOn);  }}  />
        </View>
      </View>
    )
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    flexDirection: 'row',
    padding: 50
  },
  containerLeft: {
    width: '50%'
  },
  containerRight: {
    width: '50%',
    fontSize: 19
  },
  featureheader: {
    fontSize: 19
  }
});

export default Customswitch;
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...