首页 > 解决方案 > 本机基础标签 - 知道如何删除标签周围的边框吗?

问题描述

以下屏幕截图是下面提供的代码的结果。知道如何删除标签周围的边框吗?

在此处输入图像描述

import React from 'react';
import { SafeAreaView } from 'react-native';
import { Container, Header, Title, Text, Tabs, Tab } from 'native-base';

export default class Settings extends React.Component {
  static navigationOptions = {
    header: null
  };

  render() {
    return (
      <SafeAreaView style={{ flex: 1 }}>
        <Container
          style={{ flex: 1, backgroundColor: '#fff', marginTop: 30 }}>
          <Header hasTabs transparent>
              <Title style={{ color: 'grey' }}>
                Settings
              </Title>
          </Header>

          <Tabs tabBarUnderlineStyle={{ backgroundColor: 'blue', height: 1 }}>
            <Tab heading="Tab1"
              tabStyle={{ backgroundColor: 'white' }}
              textStyle={{ color: 'grey' }}
              activeTabStyle={{ backgroundColor: 'white' }}
              activeTextStyle={{ color: 'blue' }}>
              <Text>TODO: Tab1</Text>
            </Tab>

            <Tab heading="Tab2"
              tabStyle={{ backgroundColor: 'white' }}
              textStyle={{ color: 'grey' }}
              activeTabStyle={{ backgroundColor: 'white' }}
              activeTextStyle={{ color: 'blue' }}>
              <Text>TODO: Tab2</Text>
            </Tab>
          </Tabs>

        </Container>
      </SafeAreaView>
    );
  }
}

标签: native-base

解决方案


添加tabContainerStyle={{ elevation: 0 }}<Tabs>解决这个问题。它似乎是高程(阴影)而不是边界


推荐阅读