我正在使用react-navigation。在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;
答案 0 :(得分:0)
我认为问题在于DrawerContent
对象。您应该尝试为该对象提供您想要的样式...
您正在创建一个对象DrawerContent
,其中包含对象View
并为其指定样式。在这种情况下,View
对象可能小于DrawerContent
对象...