@@ -37,7 +37,7 @@ export default class TabBarScreen extends Component {
37
37
do {
38
38
index = Math . floor ( Math . random ( ) * this . tabbar . props . children . length ) ;
39
39
} while ( index === this . state . selectedIndex ) ;
40
-
40
+
41
41
this . setState ( { selectedIndex : index } ) ;
42
42
}
43
43
} ;
@@ -82,7 +82,7 @@ export default class TabBarScreen extends Component {
82
82
removeTab = ( ) => {
83
83
const index = this . state . selectedIndex ;
84
84
const newTabs = this . state . currentTabs ;
85
-
85
+
86
86
if ( newTabs . length >= 0 ) {
87
87
newTabs . splice ( index , 1 ) ;
88
88
}
@@ -92,7 +92,7 @@ export default class TabBarScreen extends Component {
92
92
/** Actions */
93
93
getTabs ( showAddTab : boolean ) {
94
94
const tabs = _ . map ( this . state . currentTabs , tab => this . renderTabs ( tab ) ) ;
95
-
95
+
96
96
if ( showAddTab ) {
97
97
tabs . push ( this . renderAddTabsTab ( ) ) ;
98
98
} else {
@@ -126,15 +126,20 @@ export default class TabBarScreen extends Component {
126
126
< ScrollView style = { { overflow : 'visible' } } showsVerticalScrollIndicator = { false } >
127
127
< View bg-dark80 >
128
128
< TabBar style = { styles . tabbar } selectedIndex = { 0 } enableShadow >
129
- < TabBar . Item
130
- label = "single tab"
129
+ < TabBar . Item
130
+ label = "single tab"
131
131
labelStyle = { { color : Colors . green30 , fontWeight : 'bold' , textTransform : 'capitalize' } }
132
132
/>
133
133
</ TabBar >
134
134
135
- < TabBar style = { styles . tabbar } selectedIndex = { 0 } enableShadow >
136
- < TabBar . Item label = "Fixed" uppercase style = { { backgroundColor : Colors . blue80 } } />
137
- < TabBar . Item label = "Tab" badge = { { label : '100' } } uppercase style = { { backgroundColor : Colors . blue80 } } />
135
+ < TabBar
136
+ style = { styles . tabbar }
137
+ selectedIndex = { 0 }
138
+ enableShadow
139
+ // tabletMargins={{portrait: 0, landscape: 0}}
140
+ >
141
+ < TabBar . Item label = "Fixed" uppercase backgroundColor = { Colors . blue80 } />
142
+ < TabBar . Item label = "Tab" badgeProps = { { label : '100' } } uppercase style = { { backgroundColor : Colors . blue80 } } />
138
143
< TabBar . Item label = "Bar" uppercase style = { { backgroundColor : Colors . blue80 } } />
139
144
</ TabBar >
140
145
@@ -146,7 +151,7 @@ export default class TabBarScreen extends Component {
146
151
147
152
< TabBar style = { styles . tabbar } selectedIndex = { 0 } ref = { r => ( this . tabbar = r ) } enableShadow >
148
153
< TabBar . Item label = "Scroll" />
149
- < TabBar . Item label = "View" badge = { { size : 'pimpleSmall' } } />
154
+ < TabBar . Item label = "View" badgeProps = { { size : 'pimpleSmall' } } />
150
155
< TabBar . Item label = "tab" />
151
156
< TabBar . Item label = "bar" />
152
157
< TabBar . Item label = "Container" />
@@ -169,13 +174,20 @@ export default class TabBarScreen extends Component {
169
174
{ this . getTabs ( true ) }
170
175
</ TabBar >
171
176
172
- < Button
173
- size = { Button . sizes . small }
174
- margin-20
175
- label = { `Change index: ${ this . state . selectedIndex } ` }
176
- onPress = { this . changeIndex }
177
- />
178
- < TabBar style = { styles . tabbar } selectedIndex = { this . state . selectedIndex } enableShadow backgroundColor = { Colors . green70 } >
177
+ < View center >
178
+ < Button
179
+ size = { Button . sizes . small }
180
+ margin-20
181
+ label = { `Change index: ${ this . state . selectedIndex } ` }
182
+ onPress = { this . changeIndex }
183
+ />
184
+ </ View >
185
+ < TabBar
186
+ style = { styles . tabbar }
187
+ selectedIndex = { this . state . selectedIndex }
188
+ enableShadow
189
+ backgroundColor = { Colors . green70 }
190
+ >
179
191
< TabBar . Item label = "LONG LABEL" />
180
192
< TabBar . Item label = "ACTIVE" />
181
193
< TabBar . Item label = "INACTIVE" />
@@ -187,7 +199,7 @@ export default class TabBarScreen extends Component {
187
199
< TabBar . Item label = "MODE" />
188
200
</ TabBar >
189
201
190
- < View row >
202
+ < View center row >
191
203
< Button size = { Button . sizes . small } margin-20 label = { `Change Labels` } onPress = { this . changeLabels } />
192
204
< Button size = { Button . sizes . small } margin-20 label = { `Change Color` } onPress = { this . changeColors } />
193
205
</ View >
0 commit comments