在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):timomeh/react-native-material-bottom-navigation开源软件地址(OpenSource Url):https://github.com/timomeh/react-native-material-bottom-navigation开源编程语言(OpenSource Language):JavaScript 99.3%开源软件介绍(OpenSource Introduction):
A beautiful, customizable and easy-to-use
Installationnpm install react-native-material-bottom-navigation Table of ContentsDemoUsageThis library uses "render props" as established pattern for component composition. The example below illustrates the basic usage of the Bottom Navigation. All available Props are listed in the Documentation. Dive into the example below, check out the example app and take a look at the Usage Documentation. import BottomNavigation, {
FullTab
} from 'react-native-material-bottom-navigation'
export default class App extends React.Component {
tabs = [
{
key: 'games',
icon: 'gamepad-variant',
label: 'Games',
barColor: '#388E3C',
pressColor: 'rgba(255, 255, 255, 0.16)'
},
{
key: 'movies-tv',
icon: 'movie',
label: 'Movies & TV',
barColor: '#B71C1C',
pressColor: 'rgba(255, 255, 255, 0.16)'
},
{
key: 'music',
icon: 'music-note',
label: 'Music',
barColor: '#E64A19',
pressColor: 'rgba(255, 255, 255, 0.16)'
}
]
state = {
activeTab: 'games'
}
renderIcon = icon => ({ isActive }) => (
<Icon size={24} color="white" name={icon} />
)
renderTab = ({ tab, isActive }) => (
<FullTab
isActive={isActive}
key={tab.key}
label={tab.label}
renderIcon={this.renderIcon(tab.icon)}
/>
)
render() {
return (
<View style={{ flex: 1 }}>
<View style={{ flex: 1 }}>
{/* Your screen contents depending on current tab. */}
</View>
<BottomNavigation
activeTab={this.state.activeTab}
onTabPress={newTab => this.setState({ activeTab: newTab.key })}
renderTab={this.renderTab}
tabs={this.tabs}
/>
</View>
)
}
} Note: Out-of-the-box support for React Navigation (called DocumentationNotesReact Navigation SupportCheck this example for a custom React Navigation integration. In contrary to earlier releases, this library does not support React Navigation out of the box. React Navigation now ships with its own Material Bottom Navigation: You can still implement react-native-material-bottom-navigation manually by using React Navigation's Custom Navigators. Check out this example. Updated Material Design SpecsGoogle updated the Material Guidelines on Google I/O 2018 with new specifications, including a slightly changed Bottom Navigation and a new "App Bar Bottom" with a FAB in a centered cutout. react-native-material-bottom-navigation uses the older specs. ContributeContributions are always welcome. Read more in the Contribution Guides. Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. ContributorsThanks goes to these wonderful people (emoji key):
全部评论
专题导读
上一篇:redpelicans/aurelia-material: Material design for Aurelia发布时间:2022-08-17下一篇:fetrarij/ngx-daterangepicker-material: Pure Angular 2+ date range picker with ma ...发布时间:2022-08-17热门推荐
热门话题
阅读排行榜
|
请发表评论