{"id":7425,"date":"2020-04-05T11:00:17","date_gmt":"2020-04-05T02:00:17","guid":{"rendered":"https:\/\/www.vincentina.net\/?p=7425"},"modified":"2020-04-05T11:00:17","modified_gmt":"2020-04-05T02:00:17","slug":"createbottomtabnavigator%e3%81%a7%e3%83%9c%e3%83%88%e3%83%a0%e3%82%bf%e3%83%96%e3%82%92%e8%bf%bd%e5%8a%a0","status":"publish","type":"post","link":"https:\/\/www.vincentina.net\/?p=7425","title":{"rendered":"createBottomTabNavigator\u3067\u30dc\u30c8\u30e0\u30bf\u30d6\u3092\u8ffd\u52a0"},"content":{"rendered":"<div class=\"middle-margin\">\nReact Navigation\u3067\u753b\u9762\u9077\u79fb\u306e\u5b9f\u88c5\u3068\u30dc\u30c8\u30e0\u30bf\u30d6\u306e\u5b9f\u88c5\u304c\u30b7\u30f3\u30d7\u30eb\u306b\u4f5c\u308c\u308b\u30fc\uff01\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f\u30dc\u30c8\u30e0\u30bf\u30d6\u306e\u5b9f\u88c5\u3092\u3084\u308d\u3046\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u30bf\u30d6\u3067\u4f7f\u3046\u7528\u306e\u30a2\u30a4\u30b3\u30f3\u3082\u4e00\u7dd2\u306b\u8ffd\u52a0\u3059\u308b\u3068\u826f\u3044\u611f\u3058\u3067\u3059\u3002<\/p>\n<pre>yarn add @react-navigation\/bottom-tabs react-native-vector-icons<\/pre>\n<p>\u4f7f\u3048\u308b\u4e00\u89a7\u306f\u3053\u3093\u306a\u3068\u3053\u308d\u3002<br \/>\nhttps:\/\/oblador.github.io\/react-native-vector-icons\/<\/p>\n<p>\u8aaa\u660e\u3092\u898b\u308b\u611f\u3058IOS\u3060\u3068\u305d\u306e\u307e\u307e\u4f7f\u3048\u308b\u307f\u305f\u3044\u3084\u3051\u3069\u3082\u3001Android\u306e\u5834\u5408\u306fGradle\u306b\u8ffd\u8a18\u304c\u5fc5\u8981\u3067\u3001Recommend\u306a\u65b9\u6cd5\u3060\u3068<\/p>\n<pre>\r\n\/\/ \u8fd1\u3044\u3068\u3053\u308d\u306b\u4f3c\u305f\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u308a\u307e\u3059\u304c\u3053\u306e.\/android\/app\/build.gradle \u3092\u5f04\u308a\u307e\u3059\u3002\r\n\/\/ \u4f7f\u3044\u305f\u3044\u30a2\u30a4\u30b3\u30f3\u90e1\u306ettf\u3092\u8ffd\u8a18\u3002ttf\u3063\u3066\u66f8\u304d\u5fd8\u308c\u3066\u30cf\u30de\u3063\u305f\u3002\r\nproject.ext.vectoricons = [\r\n    iconFontNames: [ 'MaterialCommunityIcons.ttf', 'MaterialIcons.ttf', 'EvilIcons.ttf', 'FontAwesome.ttf' ]\r\n]\r\napply from: \"..\/..\/node_modules\/react-native-vector-icons\/fonts.gradle\"\r\n<\/pre>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067\u3002\n<\/p><\/div>\n<div class=\"small-margin\">\n\u30dc\u30c8\u30e0\u30bf\u30d6\u306e\u5b9f\u88c5\u306f\u6700\u8fd1\u30d6\u30ed\u30b0\u306b\u30a2\u30c3\u30d7\u3057\u3066\u305f\u8fd1\u304f\u3067\u6e08\u307e\u3059\u30a2\u30d7\u30ea\u306b\u8ffd\u52a0\u3057\u3066\u3044\u304f\u3064\u3082\u308a\u3067\u3001\u305f\u3060\u753b\u97621\u679a\u3060\u3051\u3060\u3068\u3061\u3087\u3063\u3068\u3055\u307f\u3057\u3044\u306e\u3067\u6025\u30d4\u30c3\u30c1\u3067\u4f5c\u696d\u6642\u95931\u6642\u9593\u307b\u3069\u304b\u3051\u30662\u679a\u306e\u30a2\u30d7\u30ea\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002<br \/>\n\u8ffd\u52a0\u3057\u305f\u30a2\u30d7\u30ea\u306f\u30b3\u30fc\u30c9\u304c\u6c5a\u3059\u304e\u308b\u306e\u3067\u30a2\u30c3\u30d7\u306f\u3067\u304d\u307e\u305b\u3093\u304c\uff08\u7b11\uff09\u4e3b\u984c\u306f\u30bf\u30d6\u3084\u3057\u3044\u3044\u304b\u306a\u3002<br \/>\n\u4f7f\u3044\u65b9\u306f\u516c\u5f0f\u30b5\u30a4\u30c8\u306b\u3082\u66f8\u3044\u3066\u3042\u308b\u3068\u304a\u308a\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092Tab.Navigator\u3067\u631f\u3081\u3070OK\u3002ReactNavigation\u4ef2\u9593\uff1f\u306eStack.Navigator\u3068\u3082\u540c\u3058\u611f\u3058\u3067\u4f7f\u3048\u307e\u3059\u304cProps\u3068\u304b\u306f\u9055\u3046\u306e\u3067\u6ce8\u610f\u304c\u5fc5\u8981\u3002\u3042\u3068\u3069\u3046\u3082\u30d0\u30fc\u30b8\u30e7\u30f35\u304b\u3089\u4f7f\u3044\u52dd\u624b\u3061\u3087\u3063\u3068\u5909\u308f\u3063\u3066\u308b\u307f\u305f\u3044\u3084\u3051\u3069\u5927\u4e08\u592b\u3067\u3059\u3002<\/p>\n<p>\u3060\u3044\u3076\u524d\u306b\u30a2\u30c3\u30d7\u3057\u3066\u305fReact Native\u306e\u30a2\u30d7\u30ea\u3067\u3082\u904e\u53bb\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u540c\u3058\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u3063\u3066\u305f\u307f\u305f\u3044\u3084\u3051\u3069\u3001\u3082\u3046\u307e\u3063\u305f\u304f\u899a\u3048\u3066\u306f\u3044\u306a\u304f\u3066\u78ba\u304b\u306b\u8a18\u8ff0\u3082\u9055\u3046\u304b\u3089\u306a\u304b\u306a\u304b\u6c17\u3065\u304b\u306a\u304b\u3063\u305f\u3067\u3059\u3002<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nconst Tab = createBottomTabNavigator();\r\n\r\nconst BottomTab = () =&gt; (\r\n  &lt;Tab.Navigator\r\n    tabBarOptions={{\r\n      activeTintColor: &quot;black&quot;,\r\n      inactiveTintColor: &quot;gray&quot;,\r\n      activeBackgroundColor: &quot;darkseagreen&quot;,\r\n    }}&gt;\r\n    &lt;Tab.Screen\r\n      name=&quot;\u3061\u304b\u3059\u307e&quot;\r\n      component={Navi}\r\n      options={{\r\n        tabBarIcon: () =&gt; &lt;Icon name=&quot;rice&quot; size={32} color=&quot;black&quot; \/&gt;,\r\n      }}\r\n    \/&gt;\r\n    &lt;Tab.Screen\r\n      name=&quot;\u304a\u5929\u6c17&quot;\r\n      component={Weather}\r\n      options={{\r\n        tabBarIcon: () =&gt; &lt;Icon name=&quot;weather-sunny&quot; size={32} color=&quot;black&quot; \/&gt;,\r\n      }}\r\n    \/&gt;\r\n    &lt;Tab.Screen\r\n      name=&quot;\u597d\u304d\u672c&quot;\r\n      component={Book}\r\n      options={{\r\n        tabBarIcon: () =&gt; &lt;Icon name=&quot;book&quot; size={32} color=&quot;black&quot; \/&gt;,\r\n      }}\r\n    \/&gt;\r\n  &lt;\/Tab.Navigator&gt;\r\n);\r\n\r\nexport default BottomTab;\r\n<\/pre>\n<\/div>\n<div class=\"small-margin\">\n\u3053\u3093\u306a\u3075\u3046\u306b\u30b3\u30f3\u30dd\u30cd\u30f3\u30c8\u3092\u631f\u3093\u3067\u3044\u304d\u307e\u3059\u3002\u4e00\u756a\u4e0a\u306e\u3061\u304b\u3059\u307e\u3068\u3044\u3046\u306e\u306f\u3001\u524d\u56de\u3042\u305f\u308a\u306e\u30d6\u30ed\u30b0\u306b\u66f8\u3044\u305f\u300c\u8fd1\u304f\u3067\u6e08\u307e\u3059\u30a2\u30d7\u30ea\u300d\u306e\u7565\u3067\u3001\u3053\u308c\u306fStack Navi\u3092\u4f7f\u3063\u3066\u307e\u3059\u304c\u3068\u304f\u306b\u554f\u984c\u306a\u3044\u3067\u3059\u3002<br \/>\nProps\u304c\u304a\u304b\u3057\u306a\u3053\u3068\u306b\u306a\u3089\u306a\u3051\u308c\u3070\u53cd\u5bfe\u306e\u5229\u7528\u65b9\u6cd5\u3067\u3082\u5927\u4e08\u592b\u3058\u3083\u306a\u3044\u304b\u3068\u3002<br \/>\n\u521d\u671f\u8a2d\u8a08\u304c\u5927\u4e8b\u306a\u3093\u3060\u306a\u3002<\/p>\n<p>\u6b8b\u308a\u306e\u4e0b\u306e2\u500b\u304c\u3001\u3055\u3063\u304d\u8a00\u3063\u3066\u305f1\u6642\u9593\u304f\u3089\u3044\u3067\u30d0\u30fc\u3063\u3068\u4f5c\u3063\u305f\u3082\u306e\u3067\u3001\u300c\u304a\u5929\u6c17\u300d\u306f\u3053\u308c\u307e\u305f\u3060\u3044\u3076\u6614\u306b\u4f5c\u3063\u305f\u30a2\u30d7\u30ea\u3092\u30b0\u30ef\u30fc\u30c3\u3068ReactHooks\u7528\u306b\u66f8\u304d\u76f4\u3057\u305f\u3082\u306e\u3067\u3001\u300c\u597d\u304d\u672c\u300d\u306fGoogleBooks\u3067\u66f8\u7c4d\u306e\u60c5\u5831\u304c\u53d6\u308c\u308bAPI\uff08\u304c\u3042\u308b\u306e\u3092\u8abf\u3079\u305f\uff09\u3092\u4f7f\u3063\u305f\u3082\u306e\u3067\u3059\u3002\n<\/p><\/div>\n<div class=\"small-margin\">\n\u3067\u3001\u3053\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092app.js\u306a\u3093\u304b\u306b\u7a81\u3063\u8fbc\u3080\u3068\u51fa\u6765\u4e0a\u304c\u308a\u3067\u3059\u3002<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nimport BottomTabs from &quot;.\/components\/BottomTab&quot;;\r\n\r\nexport default function App() {\r\n  return (\r\n    &lt;NavigationContainer&gt;\r\n      &lt;BottomTabs \/&gt;\r\n    &lt;\/NavigationContainer&gt;\r\n  );\r\n}\r\n<\/pre>\n<\/div>\n<div class=\"small-margin\">\n\u4f5c\u6210\u9014\u4e2d\u3067\u64ae\u3063\u305f\u306e\u30672\u679a\u3057\u304b\u306a\u3044\u3067\u3059\u304c\u3001\u3053\u3093\u306a\u611f\u3058\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n<a href=\"https:\/\/www.vincentina.net\/wp-content\/uploads\/2020\/04\/Screenshot_20200404-151112-2.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.vincentina.net\/wp-content\/uploads\/2020\/04\/Screenshot_20200404-151112-2.png\" alt=\"\" width=\"250\" height=\"445\" class=\"alignleft size-full wp-image-7437\" \/><\/a><br \/>\n<a href=\"https:\/\/www.vincentina.net\/wp-content\/uploads\/2020\/04\/Screenshot_20200404-150812.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.vincentina.net\/wp-content\/uploads\/2020\/04\/Screenshot_20200404-150812.png\" alt=\"\" width=\"250\" height=\"445\" class=\"alignnone size-full wp-image-7438\" \/><\/a>\n<\/div>\n<p>4\u6708\u306e\u4e0a\u65ec\u3067\u3082\u7d2b\u5916\u7dda\u91cf\u3063\u3066\u9ad8\u3044\u3093\u3084\u306a\u3042\u3002\u3068\u6bce\u5e74\u601d\u3063\u3066\u3044\u308b\u6c17\u304c\u3059\u308b\u3002<\/p>\n<div class=\"middle-margin\">\n\u30bf\u30d6\u3067\u9077\u79fb\u3057\u3066\u3082\u305d\u308c\u305e\u308c\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306f\u305d\u306e\u307e\u307e\u306e\u72b6\u614b\u3067\u518d\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u306a\u3093\u304b\u306b\u306f\u306a\u3089\u306a\u3044\u3088\u3046\u3067\u3059\u3002\u3063\u3066\u89e6\u3063\u305f\u611f\u89e6\u3092\u66f8\u3044\u3066\u3044\u308b\u3051\u308c\u3069\u30dc\u30c8\u30e0\u30bf\u30d6\u3063\u3066\u305d\u3093\u306a\u611f\u3058\u3088\u306d\u3063\u3066\u4ed6\u306e\u30a2\u30d7\u30ea\u89e6\u3063\u3066\u307f\u3066\u6c17\u4ed8\u3044\u305f\u3002<br \/>\n\u666e\u6bb5\u3044\u304b\u306b\u610f\u8b58\u3057\u306a\u3044\u3067\u4f7f\u3063\u3066\u3044\u308b\u306e\u304b\u3063\u3066\u3082\u3093\u3060\u308f\u3002<\/p>\n<p>\u4e0b\u306e\u753b\u50cf\u306f\u30bf\u30d6\u3092\u307d\u3061\u307d\u3061\u3057\u3066\u307f\u3066\u3044\u307e\u3059\u3002<\/p>\n<div style=\"width: 360px;\" class=\"wp-video\"><!--[if lt IE 9]><script>document.createElement('video');<\/script><![endif]-->\n<video class=\"wp-video-shortcode\" id=\"video-7425-1\" width=\"360\" height=\"640\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.vincentina.net\/wp-content\/uploads\/2020\/04\/20200404_191813.mp4?_=1\" \/><a href=\"https:\/\/www.vincentina.net\/wp-content\/uploads\/2020\/04\/20200404_191813.mp4\">https:\/\/www.vincentina.net\/wp-content\/uploads\/2020\/04\/20200404_191813.mp4<\/a><\/video><\/div><\/div>\n<div class=\"middle-margin\">\n\u305d\u308c\u3067\u306f\u4eca\u56de\u306f\u3053\u3093\u306a\u611f\u3058\u3067\u3059\u3002\n<\/div>\n<div class='wp_social_bookmarking_light'>        <div class=\"wsbl_twitter\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"https:\/\/www.vincentina.net\/?p=7425\" data-text=\"createBottomTabNavigator\u3067\u30dc\u30c8\u30e0\u30bf\u30d6\u3092\u8ffd\u52a0\" data-via=\"TakekenTw\" data-lang=\"ja\">Tweet<\/a><\/div><\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n","protected":false},"excerpt":{"rendered":"<p>React Navigation\u3067\u753b\u9762\u9077\u79fb\u306e\u5b9f\u88c5\u3068\u30dc\u30c8\u30e0\u30bf\u30d6\u306e\u5b9f\u88c5\u304c\u30b7\u30f3\u30d7\u30eb\u306b\u4f5c\u308c\u308b\u30fc\uff01\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f\u30dc\u30c8\u30e0\u30bf\u30d6\u306e\u5b9f\u88c5\u3092\u3084\u308d\u3046\u3068\u601d\u3044\u307e\u3059\u3002 \u30bf\u30d6\u3067\u4f7f\u3046\u7528\u306e\u30a2\u30a4\u30b3\u30f3\u3082\u4e00\u7dd2\u306b\u8ffd\u52a0\u3059\u308b\u3068\u826f\u3044\u611f\u3058\u3067\u3059\u3002 yarn add  &hellip; <a href=\"https:\/\/www.vincentina.net\/?p=7425\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;createBottomTabNavigator\u3067\u30dc\u30c8\u30e0\u30bf\u30d6\u3092\u8ffd\u52a0&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[119],"tags":[],"class_list":["post-7425","post","type-post","status-publish","format-standard","hentry","category-apli"],"_links":{"self":[{"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/posts\/7425","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7425"}],"version-history":[{"count":0,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/posts\/7425\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.vincentina.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7425"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7425"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7425"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}