android - React-Native ,Drawer Navigator(React-Navigation)中的项目在某些设备上不完全可见
问题描述
所以我的应用程序中的抽屉在理想情况下应该是这样的:
但它看起来像这样:
我正在这样创建它并将其传递给我的 stackNavigator
export const Drawer = createDrawerNavigator({
"Home":Home,
"Profile":Profile,
"Contact Us":Contact
},{
contentComponent:DrawerComponent
})
我的抽屉组件是:
class Content extends React.Component<IProps>{
render(){
return (<View>
<View
style={{
backgroundColor: '#f50057',
height: 100,
alignItems: 'center',
justifyContent: 'center',
}}
>
<Text style={{ color: 'white', fontSize: 15 }}>
{this.props.name}
</Text>
<Text style={{ color: 'white', fontSize: 15 }}>
{this.props.phone}
</Text>
</View>
<DrawerItems {...this.props} />
</View>
)
}
}
StackOverflow,欢迎任何阅读建议
解决方案
我发现这个问题的一个更愚蠢的解决方案是在我的键之后添加空格,如下所示:
export const Drawer = createDrawerNavigator({
"Home ":Home,
"Profile ":Profile,
"Contact Us ":Contact,
"Your Progress ":UserProgress
},{
contentComponent:DrawerComponent
})
推荐阅读
- c# - 修复列表视图添加数字的循环
- android - 我可以从 Flutter 中导出我的 sqlite 数据库吗?
- java - 项目顺序与属性文件不同
- javascript - 添加重复的数组值
- javascript - 在单选按钮单击上调用的 Ajax(到 php 函数)jquery 导致 javascript 函数未被引用
- eigen3 - eigen 可以支持不一致的输入输出类型吗?
- power-automate - 在 Microsoft Flow 中使用“获取用户配置文件 V2”操作时访问被拒绝 403 错误
- linux - 编写用户在会话期间执行的所有语句
- excel - 使用 getElementsByTagName() 进行网页抓取
- c# - 从身份服务器注销后如何将用户重定向到客户端应用程序?