2015-04-23 13:22:16 +00:00
|
|
|
/**
|
2017-05-06 03:50:47 +00:00
|
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
2016-07-12 12:51:57 +00:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This source code is licensed under the BSD-style license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
|
|
*
|
2017-02-25 11:05:32 +00:00
|
|
|
* @providesModule NavigatorIOSColorsExample
|
|
|
|
*/
|
2015-04-23 13:22:16 +00:00
|
|
|
'use strict';
|
|
|
|
|
2016-04-09 03:36:40 +00:00
|
|
|
var React = require('react');
|
|
|
|
var ReactNative = require('react-native');
|
2015-04-23 13:22:16 +00:00
|
|
|
var {
|
|
|
|
NavigatorIOS,
|
2016-02-22 16:27:18 +00:00
|
|
|
StatusBar,
|
2015-04-23 13:22:16 +00:00
|
|
|
StyleSheet,
|
|
|
|
Text,
|
|
|
|
View
|
2016-04-09 03:36:40 +00:00
|
|
|
} = ReactNative;
|
2015-04-23 13:22:16 +00:00
|
|
|
|
2016-07-26 08:00:02 +00:00
|
|
|
class EmptyPage extends React.Component {
|
|
|
|
render() {
|
2015-04-23 13:22:16 +00:00
|
|
|
return (
|
|
|
|
<View style={styles.emptyPage}>
|
|
|
|
<Text style={styles.emptyPageText}>
|
|
|
|
{this.props.text}
|
|
|
|
</Text>
|
|
|
|
</View>
|
|
|
|
);
|
2016-07-26 08:00:02 +00:00
|
|
|
}
|
|
|
|
}
|
2015-04-23 13:22:16 +00:00
|
|
|
|
2016-07-26 08:00:02 +00:00
|
|
|
class NavigatorIOSColors extends React.Component {
|
2017-08-25 07:03:17 +00:00
|
|
|
static title = '<NavigatorIOS> - Custom Colors';
|
2016-07-26 08:00:02 +00:00
|
|
|
static description = 'iOS navigation with custom nav bar colors';
|
2015-04-23 13:22:16 +00:00
|
|
|
|
2016-07-26 08:00:02 +00:00
|
|
|
render() {
|
2015-04-23 13:22:16 +00:00
|
|
|
// Set StatusBar with light contents to get better contrast
|
2016-02-22 16:27:18 +00:00
|
|
|
StatusBar.setBarStyle('light-content');
|
2015-04-23 13:22:16 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<NavigatorIOS
|
|
|
|
style={styles.container}
|
|
|
|
initialRoute={{
|
|
|
|
component: EmptyPage,
|
|
|
|
title: '<NavigatorIOS>',
|
|
|
|
rightButtonTitle: 'Done',
|
|
|
|
onRightButtonPress: () => {
|
2016-02-22 16:27:18 +00:00
|
|
|
StatusBar.setBarStyle('default');
|
2015-04-23 13:22:16 +00:00
|
|
|
this.props.onExampleExit();
|
|
|
|
},
|
|
|
|
passProps: {
|
|
|
|
text: 'The nav bar has custom colors with tintColor, ' +
|
|
|
|
'barTintColor and titleTextColor props.',
|
|
|
|
},
|
|
|
|
}}
|
|
|
|
tintColor="#FFFFFF"
|
|
|
|
barTintColor="#183E63"
|
|
|
|
titleTextColor="#FFFFFF"
|
2015-10-01 00:17:43 +00:00
|
|
|
translucent={true}
|
2015-04-23 13:22:16 +00:00
|
|
|
/>
|
|
|
|
);
|
2016-07-26 08:00:02 +00:00
|
|
|
}
|
|
|
|
}
|
2015-04-23 13:22:16 +00:00
|
|
|
|
|
|
|
var styles = StyleSheet.create({
|
|
|
|
container: {
|
|
|
|
flex: 1,
|
|
|
|
},
|
|
|
|
emptyPage: {
|
|
|
|
flex: 1,
|
|
|
|
paddingTop: 64,
|
|
|
|
},
|
|
|
|
emptyPageText: {
|
|
|
|
margin: 10,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
NavigatorIOSColors.external = true;
|
|
|
|
|
|
|
|
module.exports = NavigatorIOSColors;
|