NativeBase icon indicating copy to clipboard operation
NativeBase copied to clipboard

color textStyle of Tab (heading) not working

Open ghost opened this issue 7 years ago • 24 comments

hello every one, i have tab using Native-base, i use version "native-base": "^2.12.2", few day ago, i still use it, and now, i trying format color of text in Tab(heading), i tried fontSize, backgroundColor -> worked. fontWeight, color -> not working. I try using Native-base Customizer, all operations are fine, but only the tab does not work. Has the library failed? Please help me, i'm about to release with the customer. Many thank

ghost avatar Jul 22 '19 06:07 ghost

Update: initialPage working but, don't show that's page,

<Tabs initialPage={1} ///Tab heading active page 1 but not show content page onChangeTab={() => { this.setState({ isReloadData: !this.state.isReloadData }) }} tabContainerStyle={styles.tabContainer} tabBarUnderlineStyle={{ backgroundColor: 'transparent', }} > <Tab heading= {I18n.t("QR.scan")} tabStyle={styles.TAB1_STYLE} textStyle={styles.TEXT} activeTabStyle={styles.TAB1_ACTIVE_STYLE} activeTextStyle={styles.ACTIVE_TEXT} > <QRCodePage qrCode={(code) => { this.qrCode = code console.log(this.qrCode) }} /> <Tab heading= {I18n.t("QR.myQRcode")} tabStyle={styles.TAB2_STYLE} textStyle={styles.TEXT} activeTabStyle={styles.TAB2_ACTIVE_STYLE} activeTextStyle={styles.ACTIVE_TEXT} >

When i use initialPage, i can't change page like normal. Thank

ghost avatar Jul 22 '19 07:07 ghost

Update: initialPage working but, don't show that's page,

<Tabs initialPage={1} ///Tab heading active page 1 but not show content page onChangeTab={() => { this.setState({ isReloadData: !this.state.isReloadData }) }} tabContainerStyle={styles.tabContainer} tabBarUnderlineStyle={{ backgroundColor: 'transparent', }}

<Tab heading= {I18n.t("QR.scan")} tabStyle={styles.TAB1_STYLE} textStyle={styles.TEXT} activeTabStyle={styles.TAB1_ACTIVE_STYLE} activeTextStyle={styles.ACTIVE_TEXT}

<QRCodePage qrCode={(code) => { this.qrCode = code console.log(this.qrCode) }} />

<Tab heading= {I18n.t("QR.myQRcode")} tabStyle={styles.TAB2_STYLE} textStyle={styles.TEXT} activeTabStyle={styles.TAB2_ACTIVE_STYLE} activeTextStyle={styles.ACTIVE_TEXT}

When i use initialPage, i can't change page like normal. Thank

It seems to be duplicate issue of #2705

Srishti-Sharma avatar Jul 23 '19 09:07 Srishti-Sharma

I have the same issue, I override the theme variable topTabBarActiveTextColor and it no longer works. I'm on version 2.13.0 and it was OK in version 2.12.1

alexisbronchart avatar Jul 25 '19 08:07 alexisbronchart

@alexisbronchart Can you confirm that the tabs text color was changing on version 2.12.1?

sankhadeeproy007 avatar Jul 25 '19 13:07 sankhadeeproy007

@alexisbronchart Can you confirm that the tabs text color was changing on version 2.12.1?

@sankhadeeproy007 I confirm :)

alexisbronchart avatar Jul 25 '19 13:07 alexisbronchart

Please check with 2.13.3

sankhadeeproy007 avatar Jul 26 '19 08:07 sankhadeeproy007

i used 2.12.1 :D i think it's stable

ghost avatar Jul 26 '19 08:07 ghost

I'm Using 2.12.1 and getting this issue color prop doesn't work in textStyle of Tab

uday5162 avatar Aug 01 '19 12:08 uday5162

We where using 2.12.2 and font styling stopped working after we updated to RN 0.60.4. Bumped to native-base 2.13.4 and still an issue. topTabBarActiveTextColor, topTabBarTextColor does not seem to work.

Seems to work in 2.12.1 but then I get:

The following packages use deprecated "rnpm" config that will stop working from next release:
  - native-base: https://github.com/GeekyAnts/NativeBase#readme

nirre7 avatar Aug 06 '19 13:08 nirre7

Same issue it only work with ScrollableTab :/

nameer94 avatar Aug 06 '19 17:08 nameer94

Also having this issue on both 2.12.1 and 2.13.4

TabStyle and activeTabStyle are not working for me. Some information on a quite complex work around found in this stack overflow question might be helpful in finding this issue : https://stackoverflow.com/a/49307646

KevinStirling avatar Aug 11 '19 17:08 KevinStirling

@KevinStirling @uday5162 @nirre7 Can you please provide a reproducible code example, preferably a snack.

PlabanJr avatar Aug 13 '19 07:08 PlabanJr

@PlabanJr: https://github.com/nirre7/coolio, a clean react-native init with NB and ejected theme with customized: topTabBarTextColor: 'red', topTabBarActiveTextColor: 'green', Does not work with NB 2.13.5

nirre7 avatar Aug 19 '19 13:08 nirre7

Any update on this one?

nirre7 avatar Aug 29 '19 06:08 nirre7

This worked for me

            <Tab heading={
              <TabHeading>
               <Text>Anime</Text>
             </TabHeading>
            }>
              ...
            </Tab>

native base 2.13.7

nameer94 avatar Sep 05 '19 11:09 nameer94

I'm now on 2.13.8 and I can confirm that defining the heading as @nameer94 does is working:

<Tab heading={
  <TabHeading>
    <Text>Title</Text>
  </TabHeading>
}>...

However doing it like this (doc) does not work: <Tab heading={"Title"}>...

alexisbronchart avatar Sep 17 '19 14:09 alexisbronchart

Updated to 2.13.8 and implemented the "workaround" ??? that @nameer94 and @alexisbronchart mentioned above and it "works".

nirre7 avatar Sep 30 '19 11:09 nirre7

I'm running on NB 2.13.8 and faces the same issue. Previously was running on 2.12.1 which is working fine but had to upgrade to get updates on react-native-keyboard-aware-scroll-view

Hopefully there will be new release on this bug. It's a tedious work to update each tab components to use <TabHeading/> workaround.

anniewey avatar Oct 18 '19 04:10 anniewey

I'm running on NB 2.13.8 and faces the same issue. Previously was running on 2.12.1 which is working fine but had to upgrade to get updates on react-native-keyboard-aware-scroll-view

Hopefully there will be new release on this bug. It's a tedious work to update each tab components to use <TabHeading/> workaround.

same [email protected]....

ccjeaty avatar Nov 04 '19 12:11 ccjeaty

Posted an updated solution (worked fine for looping of tab)

https://stackoverflow.com/a/59042779/7908231

rjsajnani avatar Nov 26 '19 02:11 rjsajnani