Skip to content

Commit 46c6d3f

Browse files
author
Hazem El-Sisy
committed
RTL ScrollableTabBar support
1 parent 212be9b commit 46c6d3f

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

ScrollableTabBar.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const {
88
Text,
99
Platform,
1010
Dimensions,
11+
I18nManager
1112
} = ReactNative;
1213
const Button = require('./Button');
1314

@@ -157,10 +158,18 @@ const ScrollableTabBar = React.createClass({
157158
bottom: 0,
158159
};
159160

160-
const dynamicTabUnderline = {
161-
left: this.state._leftTabUnderline,
162-
width: this.state._widthTabUnderline,
163-
};
161+
const dynamicTabUnderline = {};
162+
if(I18nManager.isRTL){
163+
dynamicTabUnderline = {
164+
right: this.state._leftTabUnderline,
165+
width: this.state._widthTabUnderline,
166+
};
167+
}else{
168+
dynamicTabUnderline = {
169+
left: this.state._leftTabUnderline,
170+
width: this.state._widthTabUnderline,
171+
};
172+
}
164173

165174
return <View
166175
style={[styles.container, {backgroundColor: this.props.backgroundColor, }, this.props.style, ]}

0 commit comments

Comments
 (0)