【问题标题】:Add text in splash screen React Native Bootsplash在启动画面中添加文本 React Native Bootsplash
【发布时间】:2022-01-24 06:59:32
【问题描述】:

启动画面工作正常,但我需要在底部添加文本并且无法实现,是否可以在底部添加文本

PS我正在使用 react native bootsplash 库

【问题讨论】:

    标签: javascript android react-native splash-screen


    【解决方案1】:

    您可以修改App.tsx 文件。 (可能是您项目中的另一个名称)。 以下摘自其示例:

    const styles = StyleSheet.create({
      container: {
        flex: 1,
        justifyContent: "center",
        alignItems: "center",
        backgroundColor: "#F5FCFF",
      },
      text: {
        fontSize: 24,
        fontWeight: "700",
        margin: 20,
        lineHeight: 30,
        color: "#333",
        textAlign: "center",
      },
      bootsplash: {
        flex: 1,
        justifyContent: "center",
        alignItems: "center",
        backgroundColor: "#F5FCFF",
      },
      logo: {
        height: 89,
        width: 100,
      },
    });
    

    所以要将文本与页面底部对齐,您可以更改文本样式属性,例如:

    text: {
        fontSize: 24,
        fontWeight: "700",
        lineHeight: 30,
        color: "#333",
        textAlign: "center",
        position: fixed,
        bottom: 0,
        margin-bottom: 2%,  /* Add some space before the border */
      }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-10-16
      • 1970-01-01
      • 2023-02-21
      • 2019-12-13
      • 2023-01-20
      • 2018-11-20
      相关资源
      最近更新 更多