Skip to content

Commit 2da42c0

Browse files
author
Adam Miskiewicz
committed
Improved header + tab bar styles on iOS
1 parent cc22138 commit 2da42c0

File tree

2 files changed

+24
-9
lines changed

2 files changed

+24
-9
lines changed

src/views/Header.js

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -296,18 +296,30 @@ class Header extends React.PureComponent<void, HeaderProps, HeaderState> {
296296
}
297297
}
298298

299-
const styles = StyleSheet.create({
300-
container: {
301-
paddingTop: STATUSBAR_HEIGHT,
302-
backgroundColor: Platform.OS === 'ios' ? '#EFEFF2' : '#FFF',
303-
height: STATUSBAR_HEIGHT + APPBAR_HEIGHT,
299+
let platformContainerStyles;
300+
if (Platform.OS === 'ios') {
301+
platformContainerStyles = {
302+
borderBottomWidth: StyleSheet.hairlineWidth,
303+
borderBottomColor: 'rgba(0, 0, 0, .3)',
304+
};
305+
} else {
306+
platformContainerStyles = {
304307
shadowColor: 'black',
305308
shadowOpacity: 0.1,
306309
shadowRadius: StyleSheet.hairlineWidth,
307310
shadowOffset: {
308311
height: StyleSheet.hairlineWidth,
309312
},
310313
elevation: 4,
314+
};
315+
}
316+
317+
const styles = StyleSheet.create({
318+
container: {
319+
paddingTop: STATUSBAR_HEIGHT,
320+
backgroundColor: Platform.OS === 'ios' ? '#F7F7F7' : '#FFF',
321+
height: STATUSBAR_HEIGHT + APPBAR_HEIGHT,
322+
...platformContainerStyles,
311323
},
312324
appBar: {
313325
flex: 1,

src/views/TabView/TabBarBottom.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,11 @@ type Props = {
3939
showIcon: boolean,
4040
};
4141

42-
export default class TabBarBottom
43-
extends PureComponent<DefaultProps, Props, void> {
42+
export default class TabBarBottom extends PureComponent<
43+
DefaultProps,
44+
Props,
45+
void
46+
> {
4447
// See https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/UIKitUICatalog/UITabBar.html
4548
static defaultProps = {
4649
activeTintColor: '#3478f6', // Default active tint color in iOS 10
@@ -177,8 +180,8 @@ const styles = StyleSheet.create({
177180
height: 49, // Default tab bar height in iOS 10
178181
flexDirection: 'row',
179182
borderTopWidth: StyleSheet.hairlineWidth,
180-
borderTopColor: 'rgba(0, 0, 0, .2)',
181-
backgroundColor: '#f4f4f4', // Default background color in iOS 10
183+
borderTopColor: 'rgba(0, 0, 0, .3)',
184+
backgroundColor: '#F7F7F7', // Default background color in iOS 10
182185
},
183186
tab: {
184187
flex: 1,

0 commit comments

Comments
 (0)