Skip to content

Commit 2936c77

Browse files
committed
Add RTL support
1 parent 74a0b3f commit 2936c77

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

DefaultTabBar.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const {
77
Text,
88
View,
99
Animated,
10+
I18nManager,
1011
} = ReactNative;
1112
const Button = require('./Button');
1213

@@ -67,9 +68,10 @@ const DefaultTabBar = createReactClass({
6768
bottom: 0,
6869
};
6970

71+
const tabUnderlineOffset = containerWidth / numberOfTabs;
7072
const translateX = this.props.scrollValue.interpolate({
7173
inputRange: [0, 1],
72-
outputRange: [0, containerWidth / numberOfTabs],
74+
outputRange: [0, I18nManager.isRTL ? -tabUnderlineOffset : tabUnderlineOffset],
7375
});
7476
return (
7577
<View style={[styles.tabs, {backgroundColor: this.props.backgroundColor, }, this.props.style, ]}>

0 commit comments

Comments
 (0)