react-native - 设置 React Navigation 的 Material Top Tab Navigator 的高度样式属性
问题描述
我正在使用MaterialTopTabNavigator制作顶部标签。但是在风格上有一个问题。
我可以设置MaterialTopTabNavigator
使用多种样式的样式。当我设置tab的高度时,容器的高度会改变,而不是我认为的tab 。下面的图片是一个示例。
- 应用高度之前的样式对象
labelStyle: {
color: '#7d3aff',
fontSize: 12,
lineHeight: 12,
backgroundColor: '#a0f312',
},
tabStyle: {
borderWidth: 1,
borderColor: '#7d3aff',
borderRadius: 10,
backgroundColor: '#f012',
},
style: {
backgroundColor: '#fff',
},
indicatorStyle: {
height: 0,
},
和标签图像。
- 应用高度后的样式对象
labelStyle: {
color: '#7d3aff',
fontSize: 12,
lineHeight: 12,
backgroundColor: '#a0f312',
},
tabStyle: {
height: 30, // the only change is here
borderWidth: 1,
borderColor: '#7d3aff',
borderRadius: 10,
backgroundColor: '#f012',
},
style: {
// height: 30, // there is no difference do it or apply height in tabStyle
backgroundColor: '#fff',
},
indicatorStyle: {
height: 0,
},
和标签图像
如您所见,高度应用于标签栏的容器,而不是标签或标签栏,即标签的高度没有变化。
如何将高度应用于每个选项卡?
解决方案
推荐阅读
- xml - xsd 中是否有任何方法可以成为没有重复值的属性?
- amazon-web-services - 使用 AWS ElastiCache for Redis 进行本地/离线开发
- laravel - 如何在 Laravel 中使用日志查看器查看自定义日志文件
- html - 如何在css中制作一个椭圆形的侧边框?
- terratest - 如何将测试报告生成到文件中
- c++ - 如何将多维数组传递给 C++ 中的 Fortran 子例程
- python - 如何更快地处理熊猫(第一行输入的输出另一个)
- facebook-graph-api - 如何在页面对话/消息{message}中获取发件人电子邮件,照片?图形 API
- flutter - 如何正确导入自定义源生成包
- javascript - 按钮不启用右键单击并复制粘贴一些文本