mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-24 04:25:34 +08:00
Disable / enable swipe depending on screen. (#2906)
* Disable / enable swipe depending on screen. react-community#1760 * Updated to master * Revert "Updated to master" This reverts commit a3aede19588cdbc7fc9148d148260f51d6316e6f. * - Fixed CircleCI errors * - Fixed CircleCI errors
This commit is contained in:
@@ -168,6 +168,10 @@ Generic title that can be used as a fallback for `headerTitle` and `tabBarLabel`
|
||||
|
||||
True or false to show or hide the tab bar, if not set then defaults to true.
|
||||
|
||||
#### `swipeEnabled`
|
||||
|
||||
True or false to enable or disable swiping between tabs, if not set then defaults to TabNavigatorConfig option swipeEnabled.
|
||||
|
||||
#### `tabBarIcon`
|
||||
|
||||
React Element or a function that given `{ focused: boolean, tintColor: string }` returns a React.Node, to display in tab bar.
|
||||
|
||||
@@ -171,7 +171,6 @@ class TabView extends React.PureComponent<Props> {
|
||||
tabBarPosition,
|
||||
animationEnabled,
|
||||
configureTransition,
|
||||
swipeEnabled,
|
||||
lazy,
|
||||
initialLayout,
|
||||
screenProps,
|
||||
@@ -190,6 +189,11 @@ class TabView extends React.PureComponent<Props> {
|
||||
const tabBarVisible =
|
||||
options.tabBarVisible == null ? true : options.tabBarVisible;
|
||||
|
||||
const swipeEnabled =
|
||||
options.swipeEnabled == null
|
||||
? this.props.swipeEnabled
|
||||
: options.swipeEnabled;
|
||||
|
||||
if (tabBarComponent !== undefined && tabBarVisible) {
|
||||
if (tabBarPosition === 'bottom') {
|
||||
renderFooter = this._renderTabBar;
|
||||
|
||||
Reference in New Issue
Block a user