zoukankan      html  css  js  c++  java
  • react-native 之react-navigation createMaterialTopTabNavigator设置

    在配置navigationOptions 时可以这样,设置标题和图片icon

    navigationOptions:{
              tabBarLabel:(({tintColor,focused})=>{
                return (
                  <View>
                    <Text style={(item.label=='计划')?styles.labelStyle:styles.noniconlabelStyle}>{item.label}</Text>
                  </View>
                )
              }),
              tabBarIcon:(({tintColor,focused})=> {
                return(
                      <View>
                        <Image
                          source={item.icon}
                          style={(item.label=='计划')?styles.iconStyle:styles.noniconStyle}
                        />
                      </View>
                  )
              })
            }

    react-navigation 的

    createMaterialTopTabNavigator 

    API 可参考 官网 https://reactnavigation.org/docs/zh-Hans/material-top-tab-navigator.html

    也可参考:https://www.jianshu.com/p/86f37fb7fd02 中文介绍的很详细

    此文仅为鄙人学习笔记之用,朋友你来了,如有不明白或者建议又或者想给我指点一二,请私信我。liuw_flexi@163.com/QQ群:582039935. 我的gitHub: (学习代码都在gitHub) https://github.com/nwgdegitHub/
  • 相关阅读:
    Func,Action 的介绍及其用法
    创建自定义Windows phone 样式(二)mango下的实现
    今天五一休息
    关于地震
    第一步
    心绪不佳
    真的无语
    购物,生活
    一周结束
    who怕who
  • 原文地址:https://www.cnblogs.com/liuw-flexi/p/12263171.html
Copyright © 2011-2022 走看看