无效的道具类型:属性样式键fontSize提供给视图

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

enter image description here

enter image description here

我建立了一个屏幕,该屏幕仅在屏幕中央包含内容,并包含背景图像。我检查了代码,但没有发现错误的地方。这是代码:

import React, {Component} from "react";
import {Image} from "react-native";
import {
  Content,
  Button,
  Text,
  Icon,
} from "native-base";
class ThankyouScreen extends Component {
  render() {
    return (
      <Image style={styles.image} source={require("../img/cover.jpg")}>
        <Content
          contentContainerStyle={{
            alignSelf: "center",
            justifyContent: "center",
            flex: 1,
          }}
        >
          <Icon name="checkmark" style={styles.icon} />
          <Text style={styles.text}> Thank You For Joining Us!!</Text>
          <Button
            bordered
            style={styles.button}
            onPress={() => this.props.navigation.navigate("Home")}
          >
            <Text style={{color: "#42e5f4"}}> Back To Home</Text>
          </Button>
        </Content>
      </Image>
    );
  }
}
const styles = {
  image: {
    flex: 1,
    alignSelf: "stretch",
    width: undefined,
    height: undefined,
  },
  icon: {
    justifyContent: "center",
    alignSelf: "center",
    fontSize: 90,
    fontWeight: "bold",
    color: "#42e5f4",
  },
  text: {
    justifyContent: "center",
    alignSelf: "center",
    fontSize: 20,
    color: "#42e5f4",
  },
  button: {
    alignSelf: "center",
    marginTop: 15,
    fontSize: 10,
    fontWeight: "bold",
    color: "#0dc49d",
    borderColor: "#42e5f4",
  },
};
export default ThankyouScreen;

错误看起来很奇怪,并且很难理解为什么会导致错误。该代码有什么问题以及如何解决?

react-native react-native-android react-native-ios expo
1个回答
0
投票

这可能是NativeBase的问题。 github

中对此进行了讨论
© www.soinside.com 2019 - 2024. All rights reserved.