Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 of 7 tasks
candronikos opened this issue Sep 19, 2024 · 3 comments
Open
2 of 7 tasks
Labels
bug a bug in one of the components waiting-for-response

Comments

@candronikos
Copy link

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

  • 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

  • Android
  • iOS
  • Web
@candronikos candronikos added the bug a bug in one of the components label Sep 19, 2024
@0-CAT
Copy link

0-CAT commented Oct 9, 2024

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.

@hunglv156
Copy link

same issue

@adids1221
Copy link
Contributor

adids1221 commented Dec 17, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug a bug in one of the components waiting-for-response
Projects
None yet
Development

No branches or pull requests

4 participants