Nativebase: If i need add a custom icon that i designed, 驴How i can add in the tab <Icon>?

Created on 25 May 2017  路  7Comments  路  Source: GeekyAnts/NativeBase

need doc

All 7 comments

i have the same question... For now my app work with the default icon from ionicons on android, but in iOS i using footer tabs, this allow me add custom icons for tab.

Tried using custom FontsAwesome Icons from react-native-vector-icons. I placed these icons in the NativeBase TabHeading. Everything seems to be working fine.

@Jasbir23 I think OP means custom icon in a custom .ttf file. I'm having the same question.

I need to use my .png icon in Tabheading

@egeniegithub tried a sample code

Code

import React, { Component } from 'react';
import { Image } from "react-native";
import { Container, Header, Tab, Tabs, TabHeading, Icon, Text } from 'native-base';
export default class App extends Component {
  render() {
    return (
      <Container>
        <Header hasTabs />
        <Tabs>
          <Tab heading={<TabHeading><Image resizeMode="contain" style={{ flex: 1 }}
            source={require('./icon.png')}
          /></TabHeading>}>
            <Text>Tab one</Text>
          </Tab>
          <Tab heading={<TabHeading><Text>No Icon</Text></TabHeading>}>
            <Text>Tab two</Text>
          </Tab>
          <Tab heading={<TabHeading><Icon name="apps" /></TabHeading>}>
            <Text>Tab three</Text>
          </Tab>
        </Tabs>
      </Container>
    );
  }
}

simulator screen shot - iphone 6 - 2018-05-16 at 11 39 26

How do you change the color of the tab

How do you change the color of the tab

@JakinTayo User the TabStyle Property you can see more from: https://docs.nativebase.io/Components.html#tabs-def-headref

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eggybot picture eggybot  路  3Comments

Bundas picture Bundas  路  3Comments

inv2004 picture inv2004  路  3Comments

aloifolia picture aloifolia  路  3Comments

Landerson352 picture Landerson352  路  3Comments