代码之家  ›  专栏  ›  技术社区  ›  Franco Coronel

将填充添加到选项卡react native

  •  0
  • Franco Coronel  · 技术社区  · 7 年前

    有没有办法给我的标签添加填充?这是我使用的插件 ttps://github.com/react-native-community/react-native-tab-view

    我阅读了文档和项目中的问题,看看是否找到了什么,除了运气。

    2 回复  |  直到 7 年前
        1
  •  1
  •   Sandy.....    7 年前

    样式/自定义在该插件中可用。有以下两种方法:
    1]如果要将填充添加到整个选项卡栏中,请执行以下操作:

    <TabBar
      {...props}
      indicatorStyle={styles.indicator}
      style={styles.tabbarStyle}
    />
    

    2]如果要在选项卡中添加填充,请执行以下操作:

    <TabBar
      {...props}
      indicatorStyle={styles.indicator}
      tabStyle={styles.tabsStyle}
    />
    

    您需要相应地添加“tabbarstyle”或“tabsstyle”。希望对你有帮助。

        2
  •  -1
  •   V.Vie    7 年前

    我不知道你用的插件,但你试过这种把戏吗?

    render() {
        const style = {
            padding : '3em',
        }
        return (
            <MyComponent style={style}>
                ...
            </MyComponent>
        );
    }