构造函数
#<BlogScreen / >
您可以使用此组件在自定义屏幕中显示Blog屏幕。
属性:
的名字 | 类型 | 属性 | 描述 |
---|---|---|---|
screenTitle |
<可选> |
屏幕标题列表。默认值来自BuddyBoss网站的翻译文件 |
|
showSearch |
<可选> |
使用 |
|
hideTitle |
<可选> |
使用 |
|
hideFilters |
<可选> |
使用 |
|
hideNavigationHeader |
<可选> |
使用 |
|
headerHeight |
<可选> |
定义头高度 |
例子
/ /在custom_code /组件/ MyCustomScreen.js……import React from ' React ';import {View, Text} from 'react-native';从'react-navigation'中导入{createAppContainer};从'react-navigation-tabs'中导入{createaterialtoptabnavigator};import {createStackNavigator} from 'react-navigation-stack';import BlogScreen from "@src/containers/Custom/BlogScreen";导入actitiesscreen from "@src/containers/Custom/ actitiesscreen ";const MyCustomScreen = (props) => ( Hello {props. screenprops .auth.user.user_nicename}! ) const Tabs = createMaterialTopTabNavigator( { MyBlog: { screen: MyCustomScreen, navigationOptions: { tabBarLabel: ({ tintColor }) => ( Blog ) } }, MyActivity: { screen: ActivitiesScreen, navigationOptions: { tabBarLabel: ({ tintColor }) => ( Activities ) } } }, { initialRouteName: 'MyBlog', swipeEnabled: true, tabBarOptions: { style: { height: 45, backgroundColor: '#fff', marginTop: 50 }, indicatorStyle: { backgroundColor: 'red', }, activeTintColor: 'black', inactiveTintColor: 'gray', }, }, ); const MyCustomScreenNavigator = createStackNavigator({ Tabs: { screen: Tabs, navigationOptions: { header: null } } }); MyCustomScreenNavigator.navigationOptions = { header: null } export default MyCustomScreenNavigator; //In custom_code/index.js... ... import MyCustomScreen from "./components/MyCustomScreen"; export const applyCustomCode = externalCodeSetup => { externalCodeSetup.navigationApi.addNavigationRoute( "book", "BookScreen", MyCustomScreen, "All" ); externalCodeSetup.navigationApi.addNavigationRoute( "book", "BookScreen", MyCustomScreen, "Main" ); }