【问题标题】:Background color covers only a half of the drawer背景色只占抽屉的一半
【发布时间】:2017-07-29 07:21:10
【问题描述】:

我正在使用反应导航。在 DrawerContent 中,我添加了所有需要的东西来使抽屉的背景变成绿色,而它只覆盖了抽屉的一半。这是抽屉的代码和图像。 Here is the image

import React, { Component } from "react";

import { View, ScrollView,Button,Text,StyleSheet } from "react-native";

import { DrawerItems } from 'react-navigation';

const  DrawerContent = (props) => (

  <View style={style.container}>

    <DrawerItems {...props} />

  </View>

);

const style = StyleSheet.create({

  container: {

  flex:1

  height: null,

    backgroundColor: '#00FF00',
  },
});

export default DrawerContent;

【问题讨论】:

    标签: reactjs react-native react-native-android react-native-ios react-navigation


    【解决方案1】:

    我认为问题出在DrawerContent 对象上。您应该尝试为该对象赋予您想要的样式...

    您正在创建一个对象DrawerContent,其中包含对象View,并为其赋予样式。在这种情况下,View 对象可能小于DrawerContent 对象...

    【讨论】:

    • 我从 react-navigation 文档中获取了大部分代码,所以里面有 View 标签。你看过上面的图片吗?
    猜你喜欢
    • 1970-01-01
    • 2018-12-18
    • 1970-01-01
    • 2018-06-05
    • 2013-06-10
    • 2021-12-22
    • 1970-01-01
    • 2017-12-29
    • 1970-01-01
    相关资源
    最近更新 更多