react-native-ui-lib icon indicating copy to clipboard operation
react-native-ui-lib copied to clipboard

TabBar in TabController.PageCarousel not rendering in Android but working in web

Open candronikos opened this issue 1 year ago • 8 comments

Description

The code below renders correctly in the web and I am able to scroll between them and move to the page corresponding to the item in the TabBar when clicked. The same goes for the Android implementation when running from my phone but the TabBar is not visible.

Related to

  • [X] Components
  • [ ] Demo
  • [ ] Docs
  • [ ] Typings

Steps to reproduce

Create an expo project and try running in both the web and android.

Expected behavior

I expected the TabBar to render on the bottom of the screen of my phone.

Actual behavior

TabBar is not visible at all but I am able to scroll between the tabs.

Code snippet

const Page = () => {
  return (
    <View style={{height:"100%", flex:1}}>
      <TabController
        items={[{ label: 'Page1' }, { label: 'Page2' }, { label: 'Page3' }, { label: 'Page4' }]}
        asCarousel={true}
      >
        <TabController.PageCarousel>
          <TabController.TabPage index={0}><Page1/></TabController.TabPage>
          <TabController.TabPage index={1}><Page2/></TabController.TabPage>
          <TabController.TabPage index={2}><Page3/></TabController.TabPage>
          <TabController.TabPage index={3}><Page4/></TabController.TabPage>
        </TabController.PageCarousel>
        <Text>Hi</Text>
        <TabController.TabBar enableShadows backgroundColor="black"/>
        <Text>Bye</Text>
      </TabController>
    </View>
  )
}

Environment

  • Windows 10
  • React Native version: 0.74.5
  • React Native UI Lib version: ^7.31.0

Affected platforms

  • [X] Android
  • [ ] iOS
  • [ ] Web

candronikos avatar Sep 19 '24 07:09 candronikos

I believe this is happening in iOS also, unless I'm doing something wrong. I got no tabs after adding a TabBar:

CleanShot 2024-10-08 at 21 20 52

With this code:

<TabController
	items={[
		{ label: "First" },
		{ label: "Second" },
		{ label: "Third" },
	]}
>
	<TabController.TabBar activeBackgroundColor={Colors.blue30} />
	<TabController.TabPage index={0}>
		<Text blue20 text20>
			Page 1!
		</Text>
	</TabController.TabPage>
	<TabController.TabPage index={1} lazy>
		<Text blue20 text20>
			Page 2!
		</Text>
	</TabController.TabPage>
	<TabController.TabPage index={2} lazy>
		<Text blue20 text20>
			Page 3!
		</Text>
	</TabController.TabPage>
</TabController>

But if I add containerStyle={{ height: 40 }}, they appear:

CleanShot 2024-10-08 at 21 21 41

Versions

RN 0.75.4, RNUI 7.32.0.

0-CAT avatar Oct 09 '24 04:10 0-CAT

same issue

hunglv156 avatar Nov 07 '24 09:11 hunglv156

Hi guys, does this reproduce on RN 0.73 ? @hunglv156 @0-CAT @candronikos

I didn't managed to reproduce the issue on Android and on IOS seems to work fine on RN 0.73 (which is the version we are supporting currently). Please try to upgrade the UILIB version to the latest 7.34.

adids1221 avatar Dec 17 '24 15:12 adids1221

Hi guys, does this reproduce on RN 0.73 ?

Sorry for the late reply. Unfortunately, my project team has migrated to a different framework so I'm not able to verify. We were on RN v0.75.6 at the time, so it's possible it's an issue with changes made to RN since v0.73—but I can't confirm.

0-CAT avatar Jan 03 '25 01:01 0-CAT

same issue on RN 0.73.11

ee-dd-cc avatar Mar 23 '25 06:03 ee-dd-cc

@ee-dd-cc Downgraded to 7.20.3 Works for me

mtx-dev avatar May 19 '25 08:05 mtx-dev

same on RN 0.79.5

iamkem avatar Jul 11 '25 02:07 iamkem

Hello,

We have a version that supports new-arch (RN77), you can use the next tag for now. Please make sure to go over the v8 doc, it includes breaking changes and some known issues.

Please close this ticket if it solved your bug.

M-i-k-e-l avatar Oct 23 '25 11:10 M-i-k-e-l