From e2b3af955b1594304e5e9db483c47048e49f4d3a Mon Sep 17 00:00:00 2001 From: Shi Lei Date: Sun, 24 Feb 2019 21:15:21 +0800 Subject: [PATCH] feat: add `contentContainerStyle` to TabBar (#687) --- README.md | 4 ++++ src/TabBar.js | 3 +++ 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index cd09a61c..03194c4a 100644 --- a/README.md +++ b/README.md @@ -392,6 +392,10 @@ Style to apply to the active indicator. Style to apply to the tab item label. +##### `contentContainerStyle` + +Style to apply to the inner container for tabs. + ##### `style` Style to apply to the tab bar container. diff --git a/src/TabBar.js b/src/TabBar.js index ab59bd8c..c83bd468 100644 --- a/src/TabBar.js +++ b/src/TabBar.js @@ -48,6 +48,7 @@ export type Props = {| tabStyle?: ViewStyleProp, indicatorStyle?: ViewStyleProp, labelStyle?: TextStyleProp, + contentContainerStyle?: ViewStyleProp, style?: ViewStyleProp, |}; @@ -257,6 +258,7 @@ export default class TabBar extends React.Component, State> { tabStyle, labelStyle, indicatorStyle, + contentContainerStyle, style, } = this.props; const { routes } = navigationState; @@ -300,6 +302,7 @@ export default class TabBar extends React.Component, State> { contentContainerStyle={[ styles.tabContent, scrollEnabled ? null : styles.container, + contentContainerStyle, ]} scrollEventThrottle={16} onScroll={Animated.event(