mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
3de2e98ec0
Deploy website version based on c9c34bcae09207d55fc8663cc7a2a7ecb83a9811
485 lines
63 KiB
HTML
485 lines
63 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>NavigatorIOS · React Native</title><meta name="viewport" content="width=device-width"/><meta name="generator" content="Docusaurus"/><meta name="description" content="<p><code>NavigatorIOS</code> is a wrapper around <a href="https://developer.apple.com/library/ios/documentation/UIKit/Reference/UINavigationController_Class/"><code>UINavigationController</code></a>, enabling you to implement a navigation stack. It works exactly the same as it would on a native app using <code>UINavigationController</code>, providing the same animations and behavior from UIKit.</p>
|
||
"/><meta name="docsearch:version" content="0.49"/><meta name="docsearch:language" content="en"/><meta property="og:title" content="NavigatorIOS · React Native"/><meta property="og:type" content="website"/><meta property="og:url" content="https://facebook.github.io/react-native/"/><meta property="og:description" content="<p><code>NavigatorIOS</code> is a wrapper around <a href="https://developer.apple.com/library/ios/documentation/UIKit/Reference/UINavigationController_Class/"><code>UINavigationController</code></a>, enabling you to implement a navigation stack. It works exactly the same as it would on a native app using <code>UINavigationController</code>, providing the same animations and behavior from UIKit.</p>
|
||
"/><meta name="twitter:card" content="summary"/><link rel="shortcut icon" href="/react-native/img/favicon.png"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/solarized-dark.min.css"/><link rel="alternate" type="application/atom+xml" href="https://facebook.github.io/react-native/blog/atom.xml" title="React Native Blog ATOM Feed"/><link rel="alternate" type="application/rss+xml" href="https://facebook.github.io/react-native/blog/feed.xml" title="React Native Blog RSS Feed"/><script>
|
||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||
|
||
ga('create', 'UA-41298772-2', 'auto');
|
||
ga('send', 'pageview');
|
||
</script><script type="text/javascript" src="https://snack.expo.io/embed.js"></script><script type="text/javascript" src="/react-native/js/codeblocks.js"></script><script src="https://unpkg.com/vanilla-back-to-top@7.1.14/dist/vanilla-back-to-top.min.js"></script><script>
|
||
document.addEventListener('DOMContentLoaded', function() {
|
||
addBackToTop(
|
||
{"zIndex":100}
|
||
)
|
||
});
|
||
</script><script src="/react-native/js/scrollSpy.js"></script><link rel="stylesheet" href="/react-native/css/prism.css"/><link rel="stylesheet" href="/react-native/css/main.css"/><script src="/react-native/js/codetabs.js"></script></head><body class="sideNavVisible"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/react-native/"><img class="logo" src="/react-native/img/header_logo.png" alt="React Native"/><h2 class="headerTitleWithLogo">React Native</h2></a><a href="/react-native/versions"><h3>0.49</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/react-native/docs/0.49/getting-started" target="_self">Docs</a></li><li class="siteNavGroupActive"><a href="/react-native/docs/0.49/activityindicator" target="_self">API</a></li><li class=""><a href="/react-native/help" target="_self">Community</a></li><li class=""><a href="/react-native/blog/" target="_self">Blog</a></li><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li><li class=""><a href="https://github.com/facebook/react-native" target="_self">GitHub</a></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><div class="hamburger-menu"><div class="line1"></div><div class="line2"></div><div class="line3"></div></div></div><h2><i>›</i><span>Components</span></h2></div><div class="navGroups"><div class="navGroup"><h3 class="navGroupCategoryTitle collapsible">The Basics<span class="arrow"><svg width="24" height="24" viewBox="0 0 24 24"><path fill="#565656" d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"></path><path d="M0 0h24v24H0z" fill="none"></path></svg></span></h3><ul class="hide"><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/getting-started">Getting Started</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/tutorial">Learn the Basics</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/props">Props</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/state">State</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/style">Style</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/height-and-width">Height and Width</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/flexbox">Layout with Flexbox</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/handling-text-input">Handling Text Input</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/handling-touches">Handling Touches</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/using-a-scrollview">Using a ScrollView</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/using-a-listview">Using List Views</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/network">Networking</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/more-resources">More Resources</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle collapsible">Guides<span class="arrow"><svg width="24" height="24" viewBox="0 0 24 24"><path fill="#565656" d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"></path><path d="M0 0h24v24H0z" fill="none"></path></svg></span></h3><ul class="hide"><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/components-and-apis">Components and APIs</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/platform-specific-code">Platform Specific Code</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/navigation">Navigating Between Screens</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/images">Images</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/animations">Animations</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/accessibility">Accessibility</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/improvingux">Improving User Experience</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/timers">Timers</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/debugging">Debugging</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/performance">Performance</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/gesture-responder-system">Gesture Responder System</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/javascript-environment">JavaScript Environment</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/direct-manipulation">Direct Manipulation</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/colors">Color Reference</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/integration-with-existing-apps">Integration with Existing Apps</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/running-on-device">Running On Device</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/upgrading">Upgrading to new React Native versions</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/troubleshooting">Troubleshooting</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/native-modules-setup">Native Modules Setup</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle collapsible">Guides (iOS)<span class="arrow"><svg width="24" height="24" viewBox="0 0 24 24"><path fill="#565656" d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"></path><path d="M0 0h24v24H0z" fill="none"></path></svg></span></h3><ul class="hide"><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/native-modules-ios">Native Modules</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/native-components-ios">Native UI Components</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/linking-libraries-ios">Linking Libraries</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/running-on-simulator-ios">Running On Simulator</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/communication-ios">Communication between native and React Native</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/building-for-apple-tv">Building For TV Devices</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/app-extensions">App Extensions</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle collapsible">Guides (Android)<span class="arrow"><svg width="24" height="24" viewBox="0 0 24 24"><path fill="#565656" d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"></path><path d="M0 0h24v24H0z" fill="none"></path></svg></span></h3><ul class="hide"><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/native-modules-android">Native Modules</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/native-components-android">Native UI Components</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/headless-js-android">Headless JS</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/signed-apk-android">Generating Signed APK</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/removing-default-permissions">Removing Default Permissions</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle collapsible">Components<span class="arrow"><svg width="24" height="24" viewBox="0 0 24 24"><path fill="#565656" d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"></path><path d="M0 0h24v24H0z" fill="none"></path></svg></span></h3><ul class="hide"><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/activityindicator">ActivityIndicator</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/button">Button</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/datepickerios">DatePickerIOS</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/drawerlayoutandroid">DrawerLayoutAndroid</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/flatlist">FlatList</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/image">Image</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/imagebackground">ImageBackground</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/keyboardavoidingview">KeyboardAvoidingView</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/listview">ListView</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/maskedviewios">MaskedViewIOS</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/modal">Modal</a></li><li class="navListItem navListItemActive"><a class="navItem" href="/react-native/docs/0.49/navigatorios">NavigatorIOS</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/picker">Picker</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/pickerios">PickerIOS</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/progressbarandroid">ProgressBarAndroid</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/progressviewios">ProgressViewIOS</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/refreshcontrol">RefreshControl</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/scrollview">ScrollView</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/sectionlist">SectionList</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/segmentedcontrolios">SegmentedControlIOS</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/slider">Slider</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/snapshotviewios">SnapshotViewIOS</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/statusbar">StatusBar</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/switch">Switch</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/tabbarios">TabBarIOS</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/tabbarios-item">TabBarIOS.Item</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/text">Text</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/textinput">TextInput</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/toolbarandroid">ToolbarAndroid</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/touchablehighlight">TouchableHighlight</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/touchablenativefeedback">TouchableNativeFeedback</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/touchableopacity">TouchableOpacity</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/touchablewithoutfeedback">TouchableWithoutFeedback</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/view">View</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/viewpagerandroid">ViewPagerAndroid</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/virtualizedlist">VirtualizedList</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/webview">WebView</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle collapsible">APIs<span class="arrow"><svg width="24" height="24" viewBox="0 0 24 24"><path fill="#565656" d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"></path><path d="M0 0h24v24H0z" fill="none"></path></svg></span></h3><ul class="hide"><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/accessibilityinfo">AccessibilityInfo</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/actionsheetios">ActionSheetIOS</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/alert">Alert</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/alertios">AlertIOS</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/animated">Animated</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/appregistry">AppRegistry</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/appstate">AppState</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/asyncstorage">AsyncStorage</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/backandroid">BackAndroid</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/backhandler">BackHandler</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/cameraroll">CameraRoll</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/clipboard">Clipboard</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/datepickerandroid">DatePickerAndroid</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/dimensions">Dimensions</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/easing">Easing</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/geolocation">Geolocation</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/imageeditor">ImageEditor</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/imagepickerios">ImagePickerIOS</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/imagestore">ImageStore</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/image-style-props">Image Style Props</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/interactionmanager">InteractionManager</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/keyboard">Keyboard</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/layout-props">Layout Props</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/layoutanimation">LayoutAnimation</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/linking">Linking</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/listviewdatasource">ListViewDataSource</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/netinfo">NetInfo</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/panresponder">PanResponder</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/permissionsandroid">PermissionsAndroid</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/pixelratio">PixelRatio</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/pushnotificationios">PushNotificationIOS</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/settings">Settings</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/shadow-props">Shadow Props</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/share">Share</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/statusbarios">StatusBarIOS</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/stylesheet">StyleSheet</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/systrace">Systrace</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/text-style-props">Text Style Props</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/timepickerandroid">TimePickerAndroid</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/toastandroid">ToastAndroid</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/transforms">Transforms</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/vibration">Vibration</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/vibrationios">VibrationIOS</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.49/view-style-props">View Style Props</a></li></ul></div></div></section></div><script>
|
||
var coll = document.getElementsByClassName('collapsible');
|
||
var checkActiveCategory = true;
|
||
for (var i = 0; i < coll.length; i++) {
|
||
var links = coll[i].nextElementSibling.getElementsByTagName('*');
|
||
if (checkActiveCategory){
|
||
for (var j = 0; j < links.length; j++) {
|
||
if (links[j].classList.contains('navListItemActive')){
|
||
coll[i].nextElementSibling.classList.toggle('hide');
|
||
coll[i].childNodes[1].classList.toggle('rotate');
|
||
checkActiveCategory = false;
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
|
||
coll[i].addEventListener('click', function() {
|
||
var arrow = this.childNodes[1];
|
||
arrow.classList.toggle('rotate');
|
||
var content = this.nextElementSibling;
|
||
content.classList.toggle('hide');
|
||
});
|
||
}
|
||
|
||
document.addEventListener('DOMContentLoaded', function() {
|
||
createToggler('#navToggler', '#docsNav', 'docsSliderActive');
|
||
createToggler('#tocToggler', 'body', 'tocActive');
|
||
|
||
var headings = document.querySelector('.toc-headings');
|
||
headings && headings.addEventListener('click', function(event) {
|
||
var el = event.target;
|
||
while(el !== headings){
|
||
if (el.tagName === 'A') {
|
||
document.body.classList.remove('tocActive');
|
||
break;
|
||
} else{
|
||
el = el.parentNode;
|
||
}
|
||
}
|
||
}, false);
|
||
|
||
function createToggler(togglerSelector, targetSelector, className) {
|
||
var toggler = document.querySelector(togglerSelector);
|
||
var target = document.querySelector(targetSelector);
|
||
|
||
if (!toggler) {
|
||
return;
|
||
}
|
||
|
||
toggler.onclick = function(event) {
|
||
event.preventDefault();
|
||
|
||
target.classList.toggle(className);
|
||
};
|
||
}
|
||
});
|
||
</script></nav></div><div class="container mainContainer"><div class="wrapper"><div class="post"><header class="postHeader"><a class="edit-page-link button" href="https://github.com/facebook/react-native-website/blob/master/docs/navigatorios.md" target="_blank" rel="noreferrer noopener">Edit</a><h1 class="postHeaderTitle">NavigatorIOS</h1></header><article><div><span><p><code>NavigatorIOS</code> is a wrapper around <a href="https://developer.apple.com/library/ios/documentation/UIKit/Reference/UINavigationController_Class/"><code>UINavigationController</code></a>, enabling you to implement a navigation stack. It works exactly the same as it would on a native app using <code>UINavigationController</code>, providing the same animations and behavior from UIKit.</p>
|
||
<p>As the name implies, it is only available on iOS. Take a look at <a href="https://reactnavigation.org/"><code>React Navigation</code></a> for a cross-platform solution in JavaScript, or check out either of these components for native solutions: <a href="http://airbnb.io/native-navigation/">native-navigation</a>, <a href="https://github.com/wix/react-native-navigation">react-native-navigation</a>.</p>
|
||
<p>To set up the navigator, provide the <code>initialRoute</code> prop with a route object. A route object is used to describe each scene that your app navigates to. <code>initialRoute</code> represents the first route in your navigator.</p>
|
||
<pre><code class="hljs"><span class="hljs-keyword">import</span> <span class="hljs-type">PropTypes</span> from <span class="hljs-symbol">'prop</span>-types';
|
||
<span class="hljs-keyword">import</span> <span class="hljs-type">React</span>, { <span class="hljs-type">Component</span> } from <span class="hljs-symbol">'reac</span>t';
|
||
<span class="hljs-keyword">import</span> { <span class="hljs-type">NavigatorIOS</span>, <span class="hljs-type">Text</span> } from <span class="hljs-symbol">'react</span>-native';
|
||
|
||
export <span class="hljs-keyword">default</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">NavigatorIOSApp</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">Component</span> </span>{
|
||
render() {
|
||
<span class="hljs-keyword">return</span> (
|
||
<<span class="hljs-type">NavigatorIOS</span>
|
||
initialRoute={{
|
||
component: <span class="hljs-type">MyScene</span>,
|
||
title: <span class="hljs-symbol">'My</span> <span class="hljs-type">Initial</span> <span class="hljs-type">Scene</span>',
|
||
}}
|
||
style={{flex: <span class="hljs-number">1</span>}}
|
||
/>
|
||
);
|
||
}
|
||
}
|
||
|
||
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyScene</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">Component</span> </span>{
|
||
static propTypes = {
|
||
title: <span class="hljs-type">PropTypes</span>.string.isRequired,
|
||
navigator: <span class="hljs-type">PropTypes</span>.<span class="hljs-keyword">object</span>.isRequired,
|
||
}
|
||
|
||
_onForward = () => {
|
||
<span class="hljs-keyword">this</span>.props.navigator.push({
|
||
title: <span class="hljs-symbol">'Scene</span> ' + nextIndex,
|
||
});
|
||
}
|
||
|
||
render() {
|
||
<span class="hljs-keyword">return</span> (
|
||
<<span class="hljs-type">View</span>>
|
||
<<span class="hljs-type">Text</span>><span class="hljs-type">Current</span> <span class="hljs-type">Scene</span>: { <span class="hljs-keyword">this</span>.props.title }</<span class="hljs-type">Text</span>>
|
||
<<span class="hljs-type">TouchableHighlight</span> onPress={<span class="hljs-keyword">this</span>._onForward}>
|
||
<<span class="hljs-type">Text</span>><span class="hljs-type">Tap</span> me to load the next scene</<span class="hljs-type">Text</span>>
|
||
</<span class="hljs-type">TouchableHighlight</span>>
|
||
</<span class="hljs-type">View</span>>
|
||
)
|
||
}
|
||
}
|
||
</code></pre>
|
||
<p>In this code, the navigator renders the component specified in initialRoute, which in this case is <code>MyScene</code>. This component will receive a <code>route</code> prop and a <code>navigator</code> prop representing the navigator. The navigator's navigation bar will render the title for the current scene, "My Initial Scene".</p>
|
||
<p>You can optionally pass in a <code>passProps</code> property to your <code>initialRoute</code>. <code>NavigatorIOS</code> passes this in as props to the rendered component:</p>
|
||
<pre><code class="hljs">initialRoute={{
|
||
component: MyScene,
|
||
title: <span class="hljs-string">'My Initial Scene'</span>,
|
||
passProps: { myProp: <span class="hljs-string">'foo'</span> }
|
||
}}
|
||
</code></pre>
|
||
<p>You can then access the props passed in via <code>{this.props.myProp}</code>.</p>
|
||
<h4><a class="anchor" aria-hidden="true" id="handling-navigation"></a><a href="#handling-navigation" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Handling Navigation</h4>
|
||
<p>To trigger navigation functionality such as pushing or popping a view, you have access to a <code>navigator</code> object. The object is passed in as a prop to any component that is rendered by <code>NavigatorIOS</code>. You can then call the relevant methods to perform the navigation action you need:</p>
|
||
<pre><code class="hljs"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyView</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">Component</span> </span>{
|
||
_handleBackPress() {
|
||
<span class="hljs-keyword">this</span>.props.navigator.pop();
|
||
}
|
||
|
||
_handleNextPress(nextRoute) {
|
||
<span class="hljs-keyword">this</span>.props.navigator.push(nextRoute);
|
||
}
|
||
|
||
render() {
|
||
const nextRoute = {
|
||
component: <span class="hljs-type">MyView</span>,
|
||
title: <span class="hljs-symbol">'Bar</span> <span class="hljs-type">That</span>',
|
||
passProps: { myProp: <span class="hljs-symbol">'ba</span>r' }
|
||
};
|
||
<span class="hljs-keyword">return</span>(
|
||
<<span class="hljs-type">TouchableHighlight</span> onPress={() => <span class="hljs-keyword">this</span>._handleNextPress(nextRoute)}>
|
||
<<span class="hljs-type">Text</span> style={{marginTop: <span class="hljs-number">200</span>, alignSelf: <span class="hljs-symbol">'cente</span>r'}}>
|
||
<span class="hljs-type">See</span> you on the other nav {<span class="hljs-keyword">this</span>.props.myProp}!
|
||
</<span class="hljs-type">Text</span>>
|
||
</<span class="hljs-type">TouchableHighlight</span>>
|
||
);
|
||
}
|
||
}
|
||
</code></pre>
|
||
<p>You can also trigger navigator functionality from the <code>NavigatorIOS</code> component:</p>
|
||
<pre><code class="hljs"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">NavvyIOS</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">Component</span> </span>{
|
||
_handleNavigationRequest() {
|
||
<span class="hljs-keyword">this</span>.refs.nav.push({
|
||
component: <span class="hljs-type">MyView</span>,
|
||
title: <span class="hljs-symbol">'Geniu</span>s',
|
||
passProps: { myProp: <span class="hljs-symbol">'geniu</span>s' },
|
||
});
|
||
}
|
||
|
||
render() {
|
||
<span class="hljs-keyword">return</span> (
|
||
<<span class="hljs-type">NavigatorIOS</span>
|
||
ref=<span class="hljs-symbol">'na</span>v'
|
||
initialRoute={{
|
||
component: <span class="hljs-type">MyView</span>,
|
||
title: <span class="hljs-symbol">'Foo</span> <span class="hljs-type">This</span>',
|
||
passProps: { myProp: <span class="hljs-symbol">'fo</span>o' },
|
||
rightButtonTitle: <span class="hljs-symbol">'Ad</span>d',
|
||
onRightButtonPress: () => <span class="hljs-keyword">this</span>._handleNavigationRequest(),
|
||
}}
|
||
style={{flex: <span class="hljs-number">1</span>}}
|
||
/>
|
||
);
|
||
}
|
||
}
|
||
</code></pre>
|
||
<p>The code above adds a <code>_handleNavigationRequest</code> private method that is invoked from the <code>NavigatorIOS</code> component when the right navigation bar item is pressed. To get access to the navigator functionality, a reference to it is saved in the <code>ref</code> prop and later referenced to push a new scene into the navigation stack.</p>
|
||
<h4><a class="anchor" aria-hidden="true" id="navigation-bar-configuration"></a><a href="#navigation-bar-configuration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Navigation Bar Configuration</h4>
|
||
<p>Props passed to <code>NavigatorIOS</code> will set the default configuration for the navigation bar. Props passed as properties to a route object will set the configuration for that route's navigation bar, overriding any props passed to the <code>NavigatorIOS</code> component.</p>
|
||
<pre><code class="hljs"><span class="hljs-selector-tag">_handleNavigationRequest</span>() {
|
||
<span class="hljs-selector-tag">this</span><span class="hljs-selector-class">.refs</span><span class="hljs-selector-class">.nav</span><span class="hljs-selector-class">.push</span>({
|
||
<span class="hljs-comment">//...</span>
|
||
<span class="hljs-attribute">passProps</span>: { <span class="hljs-attribute">myProp</span>: <span class="hljs-string">'genius'</span> },
|
||
<span class="hljs-attribute">barTintColor</span>: <span class="hljs-string">'#996699'</span>,
|
||
});
|
||
}
|
||
|
||
render() {
|
||
<span class="hljs-selector-tag">return</span> (
|
||
<NavigatorIOS
|
||
<span class="hljs-comment">//...</span>
|
||
style={{<span class="hljs-attribute">flex</span>: <span class="hljs-number">1</span>}}
|
||
barTintColor=<span class="hljs-string">'#ffffcc'</span>
|
||
/>
|
||
);
|
||
}
|
||
</code></pre>
|
||
<p>In the example above the navigation bar color is changed when the new route is pushed.</p>
|
||
<h3><a class="anchor" aria-hidden="true" id="props"></a><a href="#props" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Props</h3>
|
||
<ul>
|
||
<li><a href="navigatorios.md#initialroute"><code>initialRoute</code></a></li>
|
||
<li><a href="navigatorios.md#barstyle"><code>barStyle</code></a></li>
|
||
<li><a href="navigatorios.md#bartintcolor"><code>barTintColor</code></a></li>
|
||
<li><a href="navigatorios.md#interactivepopgestureenabled"><code>interactivePopGestureEnabled</code></a></li>
|
||
<li><a href="navigatorios.md#itemwrapperstyle"><code>itemWrapperStyle</code></a></li>
|
||
<li><a href="navigatorios.md#navigationbarhidden"><code>navigationBarHidden</code></a></li>
|
||
<li><a href="navigatorios.md#shadowhidden"><code>shadowHidden</code></a></li>
|
||
<li><a href="navigatorios.md#tintcolor"><code>tintColor</code></a></li>
|
||
<li><a href="navigatorios.md#titletextcolor"><code>titleTextColor</code></a></li>
|
||
<li><a href="navigatorios.md#translucent"><code>translucent</code></a></li>
|
||
</ul>
|
||
<h3><a class="anchor" aria-hidden="true" id="methods"></a><a href="#methods" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Methods</h3>
|
||
<ul>
|
||
<li><a href="navigatorios.md#push"><code>push</code></a></li>
|
||
<li><a href="navigatorios.md#popn"><code>popN</code></a></li>
|
||
<li><a href="navigatorios.md#pop"><code>pop</code></a></li>
|
||
<li><a href="navigatorios.md#replaceatindex"><code>replaceAtIndex</code></a></li>
|
||
<li><a href="navigatorios.md#replace"><code>replace</code></a></li>
|
||
<li><a href="navigatorios.md#replaceprevious"><code>replacePrevious</code></a></li>
|
||
<li><a href="navigatorios.md#poptotop"><code>popToTop</code></a></li>
|
||
<li><a href="navigatorios.md#poptoroute"><code>popToRoute</code></a></li>
|
||
<li><a href="navigatorios.md#replacepreviousandpop"><code>replacePreviousAndPop</code></a></li>
|
||
<li><a href="navigatorios.md#resetto"><code>resetTo</code></a></li>
|
||
</ul>
|
||
<hr>
|
||
<h1><a class="anchor" aria-hidden="true" id="reference"></a><a href="#reference" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Reference</h1>
|
||
<h2><a class="anchor" aria-hidden="true" id="props-1"></a><a href="#props-1" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Props</h2>
|
||
<h3><a class="anchor" aria-hidden="true" id="initialroute"></a><a href="#initialroute" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>initialRoute</code></h3>
|
||
<p>NavigatorIOS uses <code>route</code> objects to identify child views, their props, and navigation bar configuration. Navigation operations such as push operations expect routes to look like this the <code>initialRoute</code>.</p>
|
||
<table>
|
||
<thead>
|
||
<tr><th>Type</th><th>Required</th></tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr><td>object: {component: function,title: string,titleImage: Image.propTypes.source,passProps: object,backButtonIcon: Image.propTypes.source,backButtonTitle: string,leftButtonIcon: Image.propTypes.source,leftButtonTitle: string,leftButtonSystemIcon: Object.keys(SystemIcons),onLeftButtonPress: function,rightButtonIcon: Image.propTypes.source,rightButtonTitle: string,rightButtonSystemIcon: Object.keys(SystemIcons),onRightButtonPress: function,wrapperStyle: View.style,navigationBarHidden: bool,shadowHidden: bool,tintColor: string,barTintColor: string,barStyle: enum('default', 'black'),titleTextColor: string,translucent: bool}</td><td>Yes</td></tr>
|
||
</tbody>
|
||
</table>
|
||
<hr>
|
||
<h3><a class="anchor" aria-hidden="true" id="barstyle"></a><a href="#barstyle" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>barStyle</code></h3>
|
||
<p>The style of the navigation bar. Supported values are 'default', 'black'. Use 'black' instead of setting <code>barTintColor</code> to black. This produces a navigation bar with the native iOS style with higher translucency.</p>
|
||
<table>
|
||
<thead>
|
||
<tr><th>Type</th><th>Required</th></tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr><td>enum('default', 'black')</td><td>No</td></tr>
|
||
</tbody>
|
||
</table>
|
||
<hr>
|
||
<h3><a class="anchor" aria-hidden="true" id="bartintcolor"></a><a href="#bartintcolor" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>barTintColor</code></h3>
|
||
<p>The default background color of the navigation bar.</p>
|
||
<table>
|
||
<thead>
|
||
<tr><th>Type</th><th>Required</th></tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr><td>string</td><td>No</td></tr>
|
||
</tbody>
|
||
</table>
|
||
<hr>
|
||
<h3><a class="anchor" aria-hidden="true" id="interactivepopgestureenabled"></a><a href="#interactivepopgestureenabled" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>interactivePopGestureEnabled</code></h3>
|
||
<p>Boolean value that indicates whether the interactive pop gesture is enabled. This is useful for enabling/disabling the back swipe navigation gesture.</p>
|
||
<p>If this prop is not provided, the default behavior is for the back swipe gesture to be enabled when the navigation bar is shown and disabled when the navigation bar is hidden. Once you've provided the <code>interactivePopGestureEnabled</code> prop, you can never restore the default behavior.</p>
|
||
<table>
|
||
<thead>
|
||
<tr><th>Type</th><th>Required</th></tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr><td>bool</td><td>No</td></tr>
|
||
</tbody>
|
||
</table>
|
||
<hr>
|
||
<h3><a class="anchor" aria-hidden="true" id="itemwrapperstyle"></a><a href="#itemwrapperstyle" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>itemWrapperStyle</code></h3>
|
||
<p>The default wrapper style for components in the navigator. A common use case is to set the <code>backgroundColor</code> for every scene.</p>
|
||
<table>
|
||
<thead>
|
||
<tr><th>Type</th><th>Required</th></tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr><td>View.style</td><td>No</td></tr>
|
||
</tbody>
|
||
</table>
|
||
<hr>
|
||
<h3><a class="anchor" aria-hidden="true" id="navigationbarhidden"></a><a href="#navigationbarhidden" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>navigationBarHidden</code></h3>
|
||
<p>Boolean value that indicates whether the navigation bar is hidden by default.</p>
|
||
<table>
|
||
<thead>
|
||
<tr><th>Type</th><th>Required</th></tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr><td>bool</td><td>No</td></tr>
|
||
</tbody>
|
||
</table>
|
||
<hr>
|
||
<h3><a class="anchor" aria-hidden="true" id="shadowhidden"></a><a href="#shadowhidden" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>shadowHidden</code></h3>
|
||
<p>Boolean value that indicates whether to hide the 1px hairline shadow by default.</p>
|
||
<table>
|
||
<thead>
|
||
<tr><th>Type</th><th>Required</th></tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr><td>bool</td><td>No</td></tr>
|
||
</tbody>
|
||
</table>
|
||
<hr>
|
||
<h3><a class="anchor" aria-hidden="true" id="tintcolor"></a><a href="#tintcolor" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>tintColor</code></h3>
|
||
<p>The default color used for the buttons in the navigation bar.</p>
|
||
<table>
|
||
<thead>
|
||
<tr><th>Type</th><th>Required</th></tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr><td>string</td><td>No</td></tr>
|
||
</tbody>
|
||
</table>
|
||
<hr>
|
||
<h3><a class="anchor" aria-hidden="true" id="titletextcolor"></a><a href="#titletextcolor" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>titleTextColor</code></h3>
|
||
<p>The default text color of the navigation bar title.</p>
|
||
<table>
|
||
<thead>
|
||
<tr><th>Type</th><th>Required</th></tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr><td>string</td><td>No</td></tr>
|
||
</tbody>
|
||
</table>
|
||
<hr>
|
||
<h3><a class="anchor" aria-hidden="true" id="translucent"></a><a href="#translucent" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>translucent</code></h3>
|
||
<p>Boolean value that indicates whether the navigation bar is translucent by default</p>
|
||
<table>
|
||
<thead>
|
||
<tr><th>Type</th><th>Required</th></tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr><td>bool</td><td>No</td></tr>
|
||
</tbody>
|
||
</table>
|
||
<h2><a class="anchor" aria-hidden="true" id="methods-1"></a><a href="#methods-1" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Methods</h2>
|
||
<h3><a class="anchor" aria-hidden="true" id="push"></a><a href="#push" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>push()</code></h3>
|
||
<pre><code class="hljs css language-javascript"><span class="token function">push</span><span class="token punctuation">(</span><span class="token punctuation">(</span>route<span class="token punctuation">:</span> object<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||
</code></pre>
|
||
<p>Navigate forward to a new route.</p>
|
||
<p><strong>Parameters:</strong></p>
|
||
<table>
|
||
<thead>
|
||
<tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr><td>route</td><td>object</td><td>Yes</td><td>The new route to navigate to.</td></tr>
|
||
</tbody>
|
||
</table>
|
||
<hr>
|
||
<h3><a class="anchor" aria-hidden="true" id="popn"></a><a href="#popn" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>popN()</code></h3>
|
||
<pre><code class="hljs css language-javascript"><span class="token function">popN</span><span class="token punctuation">(</span><span class="token punctuation">(</span>n<span class="token punctuation">:</span> number<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||
</code></pre>
|
||
<p>Go back N scenes at once. When N=1, behavior matches <code>pop()</code>.</p>
|
||
<p><strong>Parameters:</strong></p>
|
||
<table>
|
||
<thead>
|
||
<tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr><td>n</td><td>number</td><td>Yes</td><td>The number of scenes to pop.</td></tr>
|
||
</tbody>
|
||
</table>
|
||
<hr>
|
||
<h3><a class="anchor" aria-hidden="true" id="pop"></a><a href="#pop" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>pop()</code></h3>
|
||
<pre><code class="hljs css language-javascript"><span class="token function">pop</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||
</code></pre>
|
||
<p>Pop back to the previous scene.</p>
|
||
<hr>
|
||
<h3><a class="anchor" aria-hidden="true" id="replaceatindex"></a><a href="#replaceatindex" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>replaceAtIndex()</code></h3>
|
||
<pre><code class="hljs css language-javascript"><span class="token function">replaceAtIndex</span><span class="token punctuation">(</span><span class="token punctuation">(</span>route<span class="token punctuation">:</span> object<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token punctuation">(</span>index<span class="token punctuation">:</span> number<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||
</code></pre>
|
||
<p>Replace a route in the navigation stack.</p>
|
||
<p><strong>Parameters:</strong></p>
|
||
<table>
|
||
<thead>
|
||
<tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr><td>route</td><td>object</td><td>Yes</td><td>The new route that will replace the specified one.</td></tr>
|
||
<tr><td>index</td><td>number</td><td>Yes</td><td>The route into the stack that should be replaced. If it is negative, it counts from the back of the stack.</td></tr>
|
||
</tbody>
|
||
</table>
|
||
<hr>
|
||
<h3><a class="anchor" aria-hidden="true" id="replace"></a><a href="#replace" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>replace()</code></h3>
|
||
<pre><code class="hljs css language-javascript"><span class="token function">replace</span><span class="token punctuation">(</span><span class="token punctuation">(</span>route<span class="token punctuation">:</span> object<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||
</code></pre>
|
||
<p>Replace the route for the current scene and immediately load the view for the new route.</p>
|
||
<p><strong>Parameters:</strong></p>
|
||
<table>
|
||
<thead>
|
||
<tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr><td>route</td><td>object</td><td>Yes</td><td>The new route to navigate to.</td></tr>
|
||
</tbody>
|
||
</table>
|
||
<hr>
|
||
<h3><a class="anchor" aria-hidden="true" id="replaceprevious"></a><a href="#replaceprevious" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>replacePrevious()</code></h3>
|
||
<pre><code class="hljs css language-javascript"><span class="token function">replacePrevious</span><span class="token punctuation">(</span><span class="token punctuation">(</span>route<span class="token punctuation">:</span> object<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||
</code></pre>
|
||
<p>Replace the route/view for the previous scene.</p>
|
||
<p><strong>Parameters:</strong></p>
|
||
<table>
|
||
<thead>
|
||
<tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr><td>route</td><td>object</td><td>Yes</td><td>The new route to will replace the previous scene.</td></tr>
|
||
</tbody>
|
||
</table>
|
||
<hr>
|
||
<h3><a class="anchor" aria-hidden="true" id="poptotop"></a><a href="#poptotop" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>popToTop()</code></h3>
|
||
<pre><code class="hljs css language-javascript"><span class="token function">popToTop</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||
</code></pre>
|
||
<p>Go back to the topmost item in the navigation stack.</p>
|
||
<hr>
|
||
<h3><a class="anchor" aria-hidden="true" id="poptoroute"></a><a href="#poptoroute" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>popToRoute()</code></h3>
|
||
<pre><code class="hljs css language-javascript"><span class="token function">popToRoute</span><span class="token punctuation">(</span><span class="token punctuation">(</span>route<span class="token punctuation">:</span> object<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||
</code></pre>
|
||
<p>Go back to the item for a particular route object.</p>
|
||
<p><strong>Parameters:</strong></p>
|
||
<table>
|
||
<thead>
|
||
<tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr><td>route</td><td>object</td><td>Yes</td><td>The new route to navigate to.</td></tr>
|
||
</tbody>
|
||
</table>
|
||
<hr>
|
||
<h3><a class="anchor" aria-hidden="true" id="replacepreviousandpop"></a><a href="#replacepreviousandpop" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>replacePreviousAndPop()</code></h3>
|
||
<pre><code class="hljs css language-javascript"><span class="token function">replacePreviousAndPop</span><span class="token punctuation">(</span><span class="token punctuation">(</span>route<span class="token punctuation">:</span> object<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||
</code></pre>
|
||
<p>Replaces the previous route/view and transitions back to it.</p>
|
||
<p><strong>Parameters:</strong></p>
|
||
<table>
|
||
<thead>
|
||
<tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr><td>route</td><td>object</td><td>Yes</td><td>The new route that replaces the previous scene.</td></tr>
|
||
</tbody>
|
||
</table>
|
||
<hr>
|
||
<h3><a class="anchor" aria-hidden="true" id="resetto"></a><a href="#resetto" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>resetTo()</code></h3>
|
||
<pre><code class="hljs css language-javascript"><span class="token function">resetTo</span><span class="token punctuation">(</span><span class="token punctuation">(</span>route<span class="token punctuation">:</span> object<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||
</code></pre>
|
||
<p>Replaces the top item and pop to it.</p>
|
||
<p><strong>Parameters:</strong></p>
|
||
<table>
|
||
<thead>
|
||
<tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr><td>route</td><td>object</td><td>Yes</td><td>The new route that will replace the topmost item.</td></tr>
|
||
</tbody>
|
||
</table>
|
||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="/react-native/docs/0.49/modal"><span class="arrow-prev">← </span><span>Modal</span></a><a class="docs-next button" href="/react-native/docs/0.49/picker"><span>Picker</span><span class="arrow-next"> →</span></a></div></div></div></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/react-native/" class="nav-home"><img src="/react-native/img/header_logo.png" alt="React Native" width="66" height="58"/></a><div><h5><a href="/react-native/docs/getting-started.html">Docs</a></h5><a href="/react-native/docs/getting-started.html">Getting Started</a><a href="/react-native/docs/tutorial.html">Tutorial</a><a href="/react-native/docs/components-and-apis.html">Components and APIs</a><a href="/react-native/docs/more-resources.html">More Resources</a></div><div><h5>Community</h5><a href="/react-native/help.html">The React Native Community</a><a href="/react-native/showcase.html">Who's using React Native?</a><a href="http://stackoverflow.com/questions/tagged/react-native" target="_blank">Ask Questions on Stack Overflow</a><a href="https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md">Contributor Guide</a></div><div><h5>More Resources</h5><a href="/react-native/blog/">Blog</a><a href="https://twitter.com/reactnative" target="_blank">Twitter</a><a href="https://github.com/facebook/react-native" target="_blank">GitHub</a><a href="http://reactjs.org" target="_blank">React</a></div></section><a href="https://code.facebook.com/projects/" target="_blank" class="fbOpenSource"><img src="/react-native/img/oss_logo.png" alt="Facebook Open Source" width="170" height="45"/></a><section class="copyright">Copyright © 2019 Facebook Inc.</section></footer></div><script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script><script>window.fbAsyncInit = function() {FB.init({appId:'1677033832619985',xfbml:true,version:'v2.7'});};(function(d, s, id){var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) {return;}js = d.createElement(s); js.id = id;js.src = '//connect.facebook.net/en_US/sdk.js';fjs.parentNode.insertBefore(js, fjs);}(document, 'script','facebook-jssdk'));
|
||
</script><script>window.twttr=(function(d,s, id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return t;js=d.createElement(s);js.id=id;js.src='https://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js, fjs);t._e = [];t.ready = function(f) {t._e.push(f);};return t;}(document, 'script', 'twitter-wjs'));</script><script>
|
||
document.addEventListener('keyup', function(e) {
|
||
if (e.target !== document.body) {
|
||
return;
|
||
}
|
||
// keyCode for '/' (slash)
|
||
if (e.keyCode === 191) {
|
||
const search = document.getElementById('search_input_react');
|
||
search && search.focus();
|
||
}
|
||
});
|
||
</script><script>
|
||
var search = docsearch({
|
||
|
||
apiKey: '2c98749b4a1e588efec53b2acec13025',
|
||
indexName: 'react-native-versions',
|
||
inputSelector: '#search_input_react',
|
||
algoliaOptions: {"facetFilters":["tags:0.49"],"hitsPerPage":5}
|
||
});
|
||
</script></body></html> |