question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add tabStyle to active tab only

See original GitHub issue

Version 4.0.0-beta.31

I’m asking if there’s a way to add a tabStyle to the active tab. This way you would be able to add a different style to the whole tab on the active state. I might just be missing something in the docs but I’m not able to see something to do this with

This is what I’m trying to achieve

screen shot 2018-08-14 at 11 00 43

I started to make a custom component but didn’t want to do this as there’s more configuration.

Here is the code

<Scene
        key="Tabs"
        tabs={true}
	tabBarPosition="bottom"
	activeBackgroundColor="#282828"
	inactiveBackgroundColor="#282828"
	inactiveTintColor="#6E6E6E"
	activeTintColor={'white'}
	tabBarStyle={{
		backgroundColor: '#282828'
	}}
	tabStyle={{
		width: '100%',
		height: '100%',
		borderTopColor: 'grey',
		borderTopWidth: 4,
		marginTop: -1,
		paddingTop: 10
	}}
	swipeEnabled={false}
	animationEnabled={false}
	panHandlers={null}
	initial={true}
>
.... tabs content

</Scene>

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
daviscabralcommented, Aug 29, 2018

Nice - thank you. Please, when you do, refer to this issue. I’ll keep this opened and marked as feature request.

1reaction
ThomasLargecommented, Aug 25, 2018

Hi @daviscabral I haven’t yet, I don’t really want to make a custom component as I would have to route all of the push / pops.

If the lib could have a active style prop for the container / single tab of the tab view that would be great. As you can see above I have added a border top to the whole container but I want to add it every tab and then change it to white when active.

When I have some time I’m going to have a look though the code and see if I can work it out. If so I will make a PR.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Applying styling to active tabs - javascript - Stack Overflow
I want to apply the same style to an active tab as when hovered over (see code). I am ...
Read more >
Create a Custom Object Tab - Salesforce Help
From Setup, in the Quick Find box, enter Tabs , then select Tabs. Click New in the Custom Object Tabs related list. Select...
Read more >
W3.CSS Tabs - W3Schools
Tabbed navigation is a way to navigate around a website. Normally, tabbed navigation uses navigation buttons (tabs) arranged together with the selected tab...
Read more >
TabNavigator reference - React Navigation
When true , tabs are rendered only when they are made active. removeClippedSubviews - Defaults to true . ... tabStyle - Style object...
Read more >
My tab style selector isn't working - Salesforce Stack Exchange
@Swetha, I've just added a screenshot and edit - not sure if that clarifies it anymore for you... I'm also extremely perplexed by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found