Comments (8)
Can you provide sample code and screenshot?
from react-native-curved-bottom-bar.
<NavigationContainer>
<CurvedBottomBar.Navigator>
<CurvedBottomBar.Screen name="name" position="left" component={HomeStackScreen} />
<CurvedBottomBar.Screen name="name" position="left" component={OtherStackScreen} />
</CurvedBottomBar.Navigator>
</NavigationContainer>
const HomeStackScreen = () => {
return (
<Stack.Navigator initialRouteName="Home">
<Stack.Screen
options={{headerShown: false}}
name="Home"
component={HomeScreen}
/>
</Stack.Navigator>
);
};
If I put a stack inside a Stack in CurvedBottomBar.Screen component like this, I get the following error.
Is there a way to use it with react navigation?
from react-native-curved-bottom-bar.
<NavigationContainer>
<CurvedBottomBar.Navigator>
<CurvedBottomBar.Screen name="home" position="left" component={()=> <HomeScreen/>} />
<CurvedBottomBar.Screen name="profile" position="right" component={()=> <HomeScreen/>} />
</CurvedBottomBar.Navigator>
</NavigationContainer>
Here is the example code.
from react-native-curved-bottom-bar.
import React, { useState } from 'react';
import { StatusBar, StyleSheet, TouchableOpacity, View } from 'react-native';
import { CurvedBottomBar } from 'react-native-curved-bottom-bar';
import Ionicons from 'react-native-vector-icons/Ionicons';
StatusBar.setBarStyle('dark-content');
const ThemeScreen = props => {
const [type, setType] = useState<'down' | 'up'>('down');
const onClickButton = () => {
if (type === 'up') {
setType('down');
alert('Change type curve down');
} else {
setType('up');
alert('Change type curve up');
}
}
const _renderIcon = (routeName: string, selectTab: string) => {
let icon = '';
switch (routeName) {
case 'title1':
icon = 'ios-home-outline';
break;
case 'title2':
icon = 'apps-outline';
break;
case 'title3':
icon = 'bar-chart-outline';
break;
case 'title4':
icon = 'person-outline';
break;
}
return (
<Ionicons name={icon} size={23} color={routeName === selectTab ? '#FF3030' : 'gray'} />
);
};
return (
<View style={styles.container}>
<CurvedBottomBar.Navigator
style={[type === 'down' && {backgroundColor: '#F5F5F5'}]}
type={type}
height={60}
circleWidth={55}
bgColor="white"
borderTopLeftRight={true}
initialRouteName="title1"
renderCircle={() => (
<TouchableOpacity
style={[type === 'down' ? styles.btnCircle : styles.btnCircleUp]} onPress={onClickButton}
>
<Ionicons name="chatbubbles-outline" size={23} />
</TouchableOpacity>
)}
tabBar={({ routeName, selectTab, navigation }) => {
return (
<TouchableOpacity
onPress={() => navigation(routeName)}
style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}
>
{_renderIcon(routeName, selectTab)}
</TouchableOpacity>
);
}}>
<CurvedBottomBar.Screen
name="title1"
position="left"
component={() => <View style={{ backgroundColor: '#BFEFFF', flex: 1 }} />}
/>
<CurvedBottomBar.Screen
name="title2"
component={() => <View style={{ backgroundColor: '#FFEBCD', flex: 1 }} />}
position="left"
/>
<CurvedBottomBar.Screen
name="title3"
component={() => <View style={{ backgroundColor: '#BFEFFF', flex: 1 }} />}
position="right"
/>
<CurvedBottomBar.Screen
name="title4"
component={() => <View style={{ backgroundColor: '#FFEBCD', flex: 1 }} />}
position="right"
/>
</CurvedBottomBar.Navigator>
</View>
);
};
export default ThemeScreen;
const styles = StyleSheet.create({
container: {
flex: 1,
},
btnCircle: {
width: 60,
height: 60,
borderRadius: 30,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: 'white',
shadowColor: "#000",
shadowOffset: {
width: 0,
height: 1,
},
shadowOpacity: 0.20,
shadowRadius: 1.41,
elevation: 1,
bottom: 28
},
btnCircleUp: {
width: 60,
height: 60,
borderRadius: 30,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: '#E8E8E8',
bottom: 18,
shadowColor: "#000",
shadowOffset: {
width: 0,
height: 1,
},
shadowOpacity: 0.20,
shadowRadius: 1.41,
elevation: 1,
},
imgCircle: {
width: 30,
height: 30,
tintColor: '#48CEF6'
},
img: {
width: 30,
height: 30,
}
});
from react-native-curved-bottom-bar.
Thank you :)
from react-native-curved-bottom-bar.
cannot we use navigators instead of only a single screen?
@hoaphantn7604 ?
from react-native-curved-bottom-bar.
<CurvedBottomBar.Screen
name="home"
position="left"
component={()=> <HomeScreen props={_props} />}
/>
You can add a props.
@abhinav-official
from react-native-curved-bottom-bar.
How to hide the top status bar line That comes from the header
from react-native-curved-bottom-bar.
Related Issues (20)
- setVisible set to true cant show again the tab bar
- react-native-curved-bottom-bar doesn't seem to be linked.make sure:
- react-native-curved-bottom-bar doesn't seem to be linked.make sure: HOT 7
- Support screen options HOT 7
- Perfomance when wrap bottom bar with Stack.Navigator HOT 8
- Lagging while clicking the tabs HOT 2
- Can we add borderColor and borderWidth to curved tab HOT 6
- Render all tabs at startup/mounting HOT 3
- Bottom padding to <CurvedBottomBar.Navigator /> component style HOT 1
- [Android] Shadow issue on Expo HOT 4
- Work with expo-router
- options={{headerShown: false}} in CurvedBottomBar.Screen is not working HOT 8
- headerShown is false HOT 7
- i am trying to show component when user click on middle circle <Animated.view
- Dynamic changing of icon
- Border Width and Radius issue HOT 1
- custom curves HOT 1
- Navigating to stack with curved bottom bar shows white screen HOT 1
- strokeColor and strokeWidth issue on V3 HOT 1
- Curved Border colour and border width
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-curved-bottom-bar.