@@ -139,7 +139,7 @@ export default class Header extends NativeBaseComponent {
139
139
</ View > )
140
140
}
141
141
}
142
- else {
142
+ else if ( buttons . length > 1 ) {
143
143
if ( Platform . OS === 'ios' ) {
144
144
newChildren . push ( < View key = 'title' style = { { position : 'absolute' , left : 0 , right : 0 , top : 13 , bottom : 0 , alignSelf : 'center' , justifyContent : 'center' } } >
145
145
{ [ title [ 0 ] , subtitle [ 0 ] ] }
@@ -171,6 +171,31 @@ export default class Header extends NativeBaseComponent {
171
171
}
172
172
173
173
}
174
+ else {
175
+ if ( Platform . OS === 'ios' ) {
176
+ newChildren . push ( < View key = 'title' style = { { position : 'absolute' , left : 0 , right : 0 , top : 13 , bottom : 0 , alignSelf : 'center' , justifyContent : 'center' } } >
177
+ { [ title [ 0 ] , subtitle [ 0 ] ] }
178
+ </ View > )
179
+
180
+ if ( childrenArray . length > 1 ) {
181
+ for ( let i = 1 ; i < childrenArray . length ; i ++ ) {
182
+ newChildren . push ( < View key = { 'btn' + ( i + 1 ) } style = { { alignItems : 'center' , justifyContent : 'flex-start' , flexDirection : 'row' , marginRight : - 14 } } >
183
+ { React . cloneElement ( childrenArray [ i ] , { } ) }
184
+ </ View > )
185
+ }
186
+ }
187
+ }
188
+ else {
189
+ newChildren . push ( < View key = 'title' style = { { flex : 3 , alignSelf : 'stretch' , justifyContent : 'center' } } >
190
+ { [ title [ 0 ] ] }
191
+ </ View > )
192
+ for ( let i = 1 ; i < childrenArray . length ; i ++ ) {
193
+ newChildren . push ( < View key = { 'btn' + ( i + 1 ) } style = { { alignItems : 'center' , justifyContent : 'flex-start' , flexDirection : 'row' , marginRight : - 7 } } >
194
+ { React . cloneElement ( childrenArray [ i ] , { } ) }
195
+ </ View > )
196
+ }
197
+ }
198
+ }
174
199
return newChildren ;
175
200
}
176
201
}
0 commit comments