-
Notifications
You must be signed in to change notification settings - Fork 46
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
work with react-navigation #2
Comments
try this |
const myTabNavigator = createBottomTabNavigator(
{ // RouteConfigs
Tab1: { screen: Tab1Screen },
Tab2: { screen: Tab2Screen },
},
{
initialRouteName: 'Tab1',
tabBarComponent: FluidTabBar,
}
);
class FluidTabBar extends Component {
render() {
return (
<TabBar
onPress={(tabIndex) => {
let route = this.props.navigation.state.routes[tabIndex];
this.props.onTabPress({route});
}}
values={[ // tabs
{
title: 'Tab 1',
icon: require('assets/icon.png')
}, {
title: 'Tab 2',
icon: require('assets/icon.png')
}
]}
/>
);
}
} In this case, pressing a tab in
const myAppContainer = createAppContainer(myTabNavigator) |
I've forked the code to make it work with react navigation here: https://github.com/pulpdood/FluidBottomNavigation-rn Make sure you pass props into the component for it to work i.e
|
@pulpdood , What a wonderful, but when I click back button on Andorid, they are like this |
@BuiChiBach Thanks, I've updated the code and I seemed to have fixed it! Also can I ask how did you make the shadow above the tab bar? I've tried box shadow, elevation etc. but it's not working :(. Thanks! |
Thanks for that you fixed, sorry reply too late, I create shadow on
android by using lib :
https://www.npmjs.com/package/react-native-simple-shadow-view :D . Hope you
like it, <3
…On Sat, Oct 19, 2019 at 12:39 PM pulpdood ***@***.***> wrote:
@BuiChiBach <https://github.com/BuiChiBach> Thanks, I've updated the code
and I seemed to have fixed it!
Also can I ask how did you make the shadow above the tab bar? I've tried
box shadow, elevation etc. but it's not working :(. Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2?email_source=notifications&email_token=AKSMQHUDZSXPSPLVYJKHQGDQPKMQ5A5CNFSM4HR6MSM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBXGBAY#issuecomment-544104579>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKSMQHVTCHRRGFJYORDB2RDQPKMQ5ANCNFSM4HR6MSMQ>
.
|
Hi. I think this animation is amazing! Any chance you could post an example with it being used with react-navigation?
The text was updated successfully, but these errors were encountered: