如何修复在使用 React Native Paper 中的复选框时出现在复选框位置的表情符号?

问题描述 投票:0回答:2

我正在使用react-native-paper中的复选框组件,并且出现的是这个表情符号而不是复选框

Baby emoji instead of checkbox screen

导入

import { Checkbox } from "react-native-paper";

代码

<Checkbox  
    status={isVisible?'checked':'unchecked'}
    onPress={()=>{
        setVisible(!isVisible);
    }}
/>
react-native checkbox react-native-paper
2个回答
0
投票

这个代码片段有助于插入下面吗?它是从here复制的,并使用

checked
代替
isVisible

import * as React from 'react';
import { Checkbox } from 'react-native-paper';

const MyComponent = () => {
  const [checked, setChecked] = React.useState(false);

  return (
    <Checkbox
      status={checked ? 'checked' : 'unchecked'}
      onPress={() => {
        setChecked(!checked);
      }}
    />
  );
};

export default MyComponent;

0
投票

安装反应本机矢量图标: https://github.com/oblador/react-native-vector-icons

© www.soinside.com 2019 - 2024. All rights reserved.