NativeBase icon indicating copy to clipboard operation
NativeBase copied to clipboard

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

Open SupriyaKalghatgi opened this issue 9 years ago • 7 comments

Ref: NativeBase Forum

SupriyaKalghatgi avatar May 25 '17 07:05 SupriyaKalghatgi

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.

cristiankmb avatar May 26 '17 20:05 cristiankmb

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 avatar Jun 07 '17 07:06 Jasbir23

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

tuononh avatar Mar 28 '18 09:03 tuononh

I need to use my .png icon in Tabheading

egeniegithub avatar May 15 '18 17:05 egeniegithub

@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

akhil-ga avatar May 16 '18 06:05 akhil-ga

How do you change the color of the tab

JakinTayo avatar Apr 17 '20 22:04 JakinTayo

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

cristiankmb avatar Apr 17 '20 22:04 cristiankmb