react native curved bottom bar
Release 3.4.0

React Native를위한 고성능, 아름답고 완전히 사용자 정의 할 수있는 곡선 바닥 내비게이션 바. React-Native-SVG 및 @React-Navigation/Bottom-TAB를 사용하여 구현되었습니다.
If you love this library , give us a star , you will be a ray of sunshine in our lives : )아름다운 UI로 기본 템플릿을 반응합니다.
npm install react - native - curved - bottom - bar -- save또는
yarn add react - native - curved - bottom - bar이제 React-Native-SVG 및 @React-Navigation/Bottom-TABS를 설치해야합니다.


| 소품 | 매개 변수 | ISREQUIRE | 설명 |
|---|---|---|---|
| 유형 | '다운'또는 'up' | 예 | 중앙 탭 항목 유형, 아래쪽 곡선 또는 위쪽 곡선 |
| 원시 | '중앙'또는 '왼쪽'또는 '오른쪽' | 아니요 | 원의 위치 버튼 |
| 초기 라우 타임 이름 | 끈 | 예 | 네비게이터의 첫 번째 부하에서 렌더링하는 경로의 이름 |
| 탭 바 | ({Routename, selectedTab, avigate}) => jsx.element | 예 | 반응 요소를 반환하여 탭 막대로 표시하는 기능 |
| 렌더링 | ({Routename, selectedTab, avigate}) => jsx.element | 예 | 반응 요소를 반환하여 중앙 탭 항목으로 표시하는 기능 |
| Circlewidth | 숫자 | 아니요 | 중앙 탭 항목의 너비를 사용자 정의합니다. 최소값은 50px이고 최대는 60px입니다 |
| 스타일 | 뷰 스타일 | 아니요 | 컨테이너 뷰 스타일 |
| 섀도우 스타일 | 뷰 스타일 | 아니요 | 그림자보기 스타일. |
| 너비 | 숫자 | 아니요 | 컨테이너 뷰의 폭을 사용자 정의합니다 |
| 키 | 숫자 | 아니요 | 컨테이너 뷰의 경우 높이 사용자 정의, 최소값은 50px이고 최대 값은 90px입니다. |
| 국경 범죄 | 부울 | 아니요 | 컨테이너 뷰의 왼쪽 및 오른쪽 상단 상단 반경 |
| Bordercolor | 끈 | 아니요 | 테두리 색상 |
| 국경적 | 숫자 | 아니요 | 테두리 너비 |
| bgcolor | 끈 | 아니요 | 컨테이너 뷰의 배경색 |
| 소품 | 매개 변수 | ISREQUIRE | 설명 |
|---|---|---|---|
| 이름 | 끈 | 예 | 점프하는 경로의 이름 |
| 위치 | '왼쪽'또는 '오른쪽'또는 '원' | 예 | 탭 바 아이콘의 위치를 원 버튼의 왼쪽 또는 오른쪽으로 설정합니다. 원을 원할 때만 "Circle"유형을 사용하여 원 버튼이 탭 뷰입니다. |
| 요소 | (props) => jsx.element | 예 | 화면 매개 변수는 대상 경로로 병합됩니다 |
| 기능 | 매개 변수 | 설명 |
|---|---|---|
| setvisible | 부울 | 탭 막대를 숨기거나 표시하는 데 사용됩니다. 예 : ref.current.setvisible (false) |

import React from 'react' ;
import {
Alert ,
Animated ,
StyleSheet ,
TouchableOpacity ,
View ,
} from 'react-native' ;
import { CurvedBottomBarExpo } from 'react-native-curved-bottom-bar' ;
import Ionicons from '@expo/vector-icons/Ionicons' ;
import { NavigationContainer } from '@react-navigation/native' ;
const Screen1 = ( ) => {
return < View style = { styles . screen1 } /> ;
} ;
const Screen2 = ( ) => {
return < View style = { styles . screen2 } /> ;
} ;
export default function App ( ) {
const _renderIcon = ( routeName , selectedTab ) => {
let icon = '' ;
switch ( routeName ) {
case 'title1' :
icon = 'ios-home-outline' ;
break ;
case 'title2' :
icon = 'settings-outline' ;
break ;
}
return (
< Ionicons
name = { icon }
size = { 25 }
color = { routeName === selectedTab ? 'black' : 'gray' }
/>
) ;
} ;
const renderTabBar = ( { routeName , selectedTab , navigate } ) => {
return (
< TouchableOpacity
onPress = { ( ) => navigate ( routeName ) }
style = { styles . tabbarItem }
>
{ _renderIcon ( routeName , selectedTab ) }
</ TouchableOpacity >
) ;
} ;
return (
< NavigationContainer >
< CurvedBottomBarExpo . Navigator
type = "DOWN"
style = { styles . bottomBar }
shadowStyle = { styles . shawdow }
height = { 55 }
circleWidth = { 50 }
bgColor = "white"
initialRouteName = "title1"
borderTopLeftRight
renderCircle = { ( { selectedTab , navigate } ) => (
< Animated . View style = { styles . btnCircleUp } >
< TouchableOpacity
style = { styles . button }
onPress = { ( ) => Alert . alert ( 'Click Action' ) }
>
< Ionicons name = { 'apps-sharp' } color = "gray" size = { 25 } />
</ TouchableOpacity >
</ Animated . View >
) }
tabBar = { renderTabBar }
>
< CurvedBottomBarExpo . Screen
name = "title1"
position = "LEFT"
component = { ( ) => < Screen1 /> }
/>
< CurvedBottomBarExpo . Screen
name = "title2"
component = { ( ) => < Screen2 /> }
position = "RIGHT"
/>
</ CurvedBottomBarExpo . Navigator >
</ NavigationContainer >
) ;
}
export const styles = StyleSheet . create ( {
container : {
flex : 1 ,
padding : 20 ,
} ,
shawdow : {
shadowColor : '#DDDDDD' ,
shadowOffset : {
width : 0 ,
height : 0 ,
} ,
shadowOpacity : 1 ,
shadowRadius : 5 ,
} ,
button : {
flex : 1 ,
justifyContent : 'center' ,
} ,
bottomBar : { } ,
btnCircleUp : {
width : 60 ,
height : 60 ,
borderRadius : 30 ,
alignItems : 'center' ,
justifyContent : 'center' ,
backgroundColor : '#E8E8E8' ,
bottom : 30 ,
shadowColor : '#000' ,
shadowOffset : {
width : 0 ,
height : 1 ,
} ,
shadowOpacity : 0.2 ,
shadowRadius : 1.41 ,
elevation : 1 ,
} ,
imgCircle : {
width : 30 ,
height : 30 ,
tintColor : 'gray' ,
} ,
tabbarItem : {
flex : 1 ,
alignItems : 'center' ,
justifyContent : 'center' ,
} ,
img : {
width : 30 ,
height : 30 ,
} ,
screen1 : {
flex : 1 ,
backgroundColor : '#BFEFFF' ,
} ,
screen2 : {
flex : 1 ,
backgroundColor : '#FFEBCD' ,
} ,
} ) ;
import React from 'react' ;
import {
Alert ,
Animated ,
StyleSheet ,
TouchableOpacity ,
View ,
} from 'react-native' ;
import { CurvedBottomBar } from 'react-native-curved-bottom-bar' ;
import Ionicons from 'react-native-vector-icons/Ionicons' ;
import { NavigationContainer } from '@react-navigation/native' ;
const Screen1 = ( ) => {
return < View style = { styles . screen1 } /> ;
} ;
const Screen2 = ( ) => {
return < View style = { styles . screen2 } /> ;
} ;
export default function App ( ) {
const _renderIcon = ( routeName , selectedTab ) => {
let icon = '' ;
switch ( routeName ) {
case 'title1' :
icon = 'ios-home-outline' ;
break ;
case 'title2' :
icon = 'settings-outline' ;
break ;
}
return (
< Ionicons
name = { icon }
size = { 25 }
color = { routeName === selectedTab ? 'black' : 'gray' }
/>
) ;
} ;
const renderTabBar = ( { routeName , selectedTab , navigate } ) => {
return (
< TouchableOpacity
onPress = { ( ) => navigate ( routeName ) }
style = { styles . tabbarItem }
>
{ _renderIcon ( routeName , selectedTab ) }
</ TouchableOpacity >
) ;
} ;
return (
< NavigationContainer >
< CurvedBottomBar . Navigator
type = "UP"
style = { styles . bottomBar }
shadowStyle = { styles . shawdow }
height = { 55 }
circleWidth = { 50 }
bgColor = "white"
initialRouteName = "title1"
borderTopLeftRight
renderCircle = { ( { selectedTab , navigate } ) => (
< Animated . View style = { styles . btnCircleUp } >
< TouchableOpacity
style = { styles . button }
onPress = { ( ) => Alert . alert ( 'Click Action' ) }
>
< Ionicons name = { 'apps-sharp' } color = "gray" size = { 25 } />
</ TouchableOpacity >
</ Animated . View >
) }
tabBar = { renderTabBar }
>
< CurvedBottomBar . Screen
name = "title1"
position = "LEFT"
component = { ( ) => < Screen1 /> }
/>
< CurvedBottomBar . Screen
name = "title2"
component = { ( ) => < Screen2 /> }
position = "RIGHT"
/>
</ CurvedBottomBar . Navigator >
</ NavigationContainer >
) ;
}
export const styles = StyleSheet . create ( {
container : {
flex : 1 ,
padding : 20 ,
} ,
shawdow : {
shadowColor : '#DDDDDD' ,
shadowOffset : {
width : 0 ,
height : 0 ,
} ,
shadowOpacity : 1 ,
shadowRadius : 5 ,
} ,
button : {
flex : 1 ,
justifyContent : 'center' ,
} ,
bottomBar : { } ,
btnCircleUp : {
width : 60 ,
height : 60 ,
borderRadius : 30 ,
alignItems : 'center' ,
justifyContent : 'center' ,
backgroundColor : '#E8E8E8' ,
bottom : 18 ,
shadowColor : '#000' ,
shadowOffset : {
width : 0 ,
height : 1 ,
} ,
shadowOpacity : 0.2 ,
shadowRadius : 1.41 ,
elevation : 1 ,
} ,
imgCircle : {
width : 30 ,
height : 30 ,
tintColor : 'gray' ,
} ,
tabbarItem : {
flex : 1 ,
alignItems : 'center' ,
justifyContent : 'center' ,
} ,
img : {
width : 30 ,
height : 30 ,
} ,
screen1 : {
flex : 1 ,
backgroundColor : '#BFEFFF' ,
} ,
screen2 : {
flex : 1 ,
backgroundColor : '#FFEBCD' ,
} ,
} ) ; 