2017-08-25 07:03:17 +00:00
|
|
|
/**
|
2018-09-11 22:27:47 +00:00
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
2017-08-25 07:03:17 +00:00
|
|
|
*
|
2018-02-17 02:24:55 +00:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2017-08-25 07:03:17 +00:00
|
|
|
*
|
|
|
|
* The examples provided by Facebook are for non-commercial testing and
|
|
|
|
* evaluation purposes only.
|
|
|
|
*
|
|
|
|
* Facebook reserves all rights not expressly granted.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
|
|
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
|
|
|
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
|
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
*
|
2018-05-11 20:32:37 +00:00
|
|
|
* @format
|
2018-08-09 15:32:04 +00:00
|
|
|
* @flow strict-local
|
2017-08-25 07:03:17 +00:00
|
|
|
*/
|
2017-08-25 17:47:50 +00:00
|
|
|
|
2017-08-25 07:03:17 +00:00
|
|
|
'use strict';
|
|
|
|
|
2018-10-30 21:29:54 +00:00
|
|
|
const React = require('react');
|
|
|
|
const ReactNative = require('react-native');
|
|
|
|
const {StyleSheet, TabBarIOS, Text, View} = ReactNative;
|
2017-08-25 07:03:17 +00:00
|
|
|
|
2018-10-30 21:29:54 +00:00
|
|
|
const base64Icon =
|
2018-05-11 20:32:37 +00:00
|
|
|
'data:image/png;base64,iVBORw0KGgo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EZ3qcSKgm0kTli3zZVS7y/iivZTweYXJ26Y+RTbV1zh3hYkgyFGSTKPfRVbRqWWVReaxYeSLarYv1Qqsmh1s95S7G+eEWK0f3jYKTbV6bOwepjfhtafsvUsqrQvrGC8YhmnO9cSCk3yuY984F1vesdHYhWJ5FvASlacshUsajFt2mUM9pqzvKGcyNJW0arTKN1GGGzQlH0tXwLDgQTurS8eIQAAAABJRU5ErkJggg==';
|
2017-08-25 07:03:17 +00:00
|
|
|
|
|
|
|
class TabBarIOSBarStyleExample extends React.Component<{}> {
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<TabBarIOS barStyle="black">
|
2018-05-11 20:32:37 +00:00
|
|
|
<TabBarIOS.Item title="Tab" icon={{uri: base64Icon, scale: 3}} selected>
|
2017-08-25 07:03:17 +00:00
|
|
|
<View style={styles.tabContent}>
|
|
|
|
<Text style={styles.tabText}>Single page</Text>
|
|
|
|
</View>
|
|
|
|
</TabBarIOS.Item>
|
|
|
|
</TabBarIOS>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-10-30 21:29:54 +00:00
|
|
|
const styles = StyleSheet.create({
|
2017-08-25 07:03:17 +00:00
|
|
|
tabContent: {
|
|
|
|
flex: 1,
|
|
|
|
alignItems: 'center',
|
|
|
|
},
|
|
|
|
tabText: {
|
|
|
|
color: 'white',
|
|
|
|
margin: 50,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2018-12-31 16:26:00 +00:00
|
|
|
exports.title = '<TabBarIOS> - Custom Bar Style';
|
|
|
|
exports.description = 'Tab-based navigation.';
|
|
|
|
exports.displayName = 'TabBarIOSBarStyleExample';
|
|
|
|
exports.examples = [
|
|
|
|
{
|
|
|
|
title: 'Custom tab bar navigation',
|
|
|
|
render: function(): React.Element<typeof TabBarIOSBarStyleExample> {
|
|
|
|
return <TabBarIOSBarStyleExample />;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
];
|