{"id":519,"date":"2022-11-22T21:27:14","date_gmt":"2022-11-22T13:27:14","guid":{"rendered":"http:\/\/gjweb.top\/?p=519"},"modified":"2022-11-22T21:27:16","modified_gmt":"2022-11-22T13:27:16","slug":"reactnavite%e5%9f%ba%e7%a1%80","status":"publish","type":"post","link":"https:\/\/gjweb.top\/?p=519","title":{"rendered":"ReactNavite\u57fa\u7840"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"\u89c4\u8303\">\u89c4\u8303<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>\u9ed8\u8ba4\u5bb9\u5668\u662f Flex \u5e03\u5c40<\/li><li>Css \u6ca1\u6709\u7ee7\u627f\u4f5c\u7528<\/li><li>Css \u5355\u4f4d\u6ca1\u6709 px \/ vh \/ vw ; \u53ef\u4ee5\u4f1a\u4f7f\u7528 &#8216;%&#8217;;<\/li><li>Css \u5c5e\u6027\u5747\u4e3a\u5927\u9a7c\u5cf0\u547d\u540d\u6cd5<\/li><li>\u83b7\u53d6\u5c4f\u5e55\u5bbd\u5ea6 Dimensions<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>import {Dimensions} from \"react-navite\"<br>const width = Dimensions.get(\"window\").width<br>const height = Dimensions.get(\"window\").height<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u53d8\u6362\">\u53d8\u6362<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ee5\u6570\u7ec4\u7684\u5f62\u5f0f\u4f7f\u7528<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;view style={{transform:&#91;{tarnslateY:300},{scale:2}]}}&gt;<br>    &lt;Text&gt;&lt;\/Text&gt;<br>&lt;\/view&gt;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u6807\u7b7e\">\u6807\u7b7e<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"view\">View<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>\u76f8\u5f53\u4e8ediv<\/li><li>\u4e0d\u80fd\u5b58\u653e\u6587\u672c\u5185\u5bb9\uff0c\u4e0d\u652f\u6301\u8bbe\u7f6e\u5b57\u4f53\u5927\u5c0f\u548c\u989c\u8272<\/li><li>\u4e0d\u80fd\u76f4\u63a5\u7ed1\u5b9a\u70b9\u51fb\u4e8b\u4ef6<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"text\">Text<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>\u6587\u672c\u6807\u7b7e<\/li><li>\u53ef\u652f\u6301\u6587\u672c\u8bbe\u7f6e\u5927\u5c0f\u548c\u989c\u8272\uff0c\u53ef\u76f4\u63a5\u7ed1\u5b9a\u5355\u51fb\u4e8b\u4ef6<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"touchbleopacity\">TouchbleOpacity<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>\u5757\u7ea7\u5bb9\u5668<\/li><li>\u652f\u6301\u6587\u672c\u8bbe\u7f6e\u5927\u5c0f\u548c\u989c\u8272\uff0c\u53ef\u76f4\u63a5 onPress \u4e8b\u4ef6\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u70b9\u51fb\u4e8b\u4ef6\u7684\u6837\u5f0f<\/li><li>\u5c5e\u6027<ul><li>onPress \u70b9\u51fb\u4e8b\u4ef6<\/li><li>activeOpacity \u4ea4\u4e92\u7684\u900f\u660e\u5ea6 0-1<\/li><\/ul><\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"image\">Image<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>\u672c\u5730\u56fe\u50cf { require(&#8220;url&#8221;) }<\/li><li>\u5728\u7ebf\u56fe\u50cf {{ url }} \uff0c <strong>\u5728\u7ebf\u56fe\u7247\u9700\u8981\u5728 style \u4e2d\u8bbe\u7f6e\u5bbd\u9ad8<\/strong><\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"gif\u56fe\u50cf\u914d\u7f6e\">gif\u56fe\u50cf\u914d\u7f6e<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728 Android \u4e0a\u652f\u6301 GIF \u548c WebP \u683c\u5f0f\u56fe\u7247<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u9ed8\u8ba4\u60c5\u51b5\u4e0b Android \u662f\u4e0d\u652f\u6301 GIF \u548c Webp \u683c\u5f0f\u7684\uff0c \u9700\u8981\u5728 android\/app\/build.gradle \u6587\u4ef6\u4e2d\u6839\u636e\u9700\u8981\u624b\u52a8\u6dfb\u52a0\u4e00\u4e0b\u6a21\u5757<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dependencies {<br> &nbsp;\/\/ \u5982\u679c\u4f60\u9700\u8981\u652f\u6301Android4.0(API level 14)\u4e4b\u524d\u7684\u7248\u672c<br> &nbsp;implementation 'com.facebook.fresco:animated-base-support:1.3.0'<br>\u200b<br> &nbsp;\/\/ \u5982\u679c\u4f60\u9700\u8981\u652f\u6301GIF\u52a8\u56fe<br> &nbsp;implementation 'com.facebook.fresco:animated-gif:2.0.0'<br>\u200b<br> &nbsp;\/\/ \u5982\u679c\u4f60\u9700\u8981\u652f\u6301WebP\u683c\u5f0f\uff0c\u5305\u62ecWebP\u52a8\u56fe<br> &nbsp;implementation 'com.facebook.fresco:animated-webp:2.1.0'<br> &nbsp;implementation 'com.facebook.fresco:webpsupport:2.0.0'<br>\u200b<br> &nbsp;\/\/ \u5982\u679c\u53ea\u9700\u8981\u652f\u6301WebP\u683c\u5f0f\u800c\u4e0d\u9700\u8981\u52a8\u56fe<br> &nbsp;implementation 'com.facebook.fresco:webpsupport:2.0.0'<br>}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"imagebackgroumd\">Imagebackgroumd<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>\u80cc\u666f\u56fe\u7247\u7528\u6cd5\u540c image \u76f8\u540c<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"textinput\">TextInput<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>\u8f93\u5165\u7ec4\u4ef6<\/li><li>\u901a\u8fc7 onChangeText \u4e8b\u4ef6\u6765\u83b7\u53d6\u8f93\u5165\u6846\u7684\u503c\uff0c\u540c change \u4e8b\u4ef6\u76f8\u540c<\/li><\/ul>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u8bed\u6cd5\">\u8bed\u6cd5<\/h2>\n\n\n\n<ol class=\"wp-block-list\"><li>RN \u652f\u6301\u63d2\u503c\u8868\u8fbe\u5f0f\u8bed\u6cd5\uff0c\u7528\u6cd5\u540creact \u76f8\u540c<\/li><li>RN \u652f\u6301\u7c7b\u7ec4\u4ef6\u548c\u51fd\u6570\u7ec4\u4ef6\uff08Hooks\uff09<\/li><li>state \u548c props \u7528\u6cd5\u540c react \u76f8\u540c<\/li><li>\u4e8b\u4ef6\u7ed1\u5b9a\u65b9\u5f0f\u540c react \u76f8\u540c<\/li><li>\u751f\u547d\u5468\u671f\u540c react \u76f8\u540c<\/li><\/ol>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u8c03\u8bd5\">\u8c03\u8bd5<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u63a8\u8350\u65b9\u5f0f\u4f7f\u7528 <a href=\"https:\/\/github.com\/jhen0409\/react-native-debugger\/releases\">React-Native-debugger<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6295\u5c4f\u5de5\u5177 <a href=\"https:\/\/gitcode.net\/mirrors\/Genymobile\/scrcpy?utm_source=csdn_github_accelerator\">scrcpy<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8c03\u8bd5\u7f51\u7edc\u8bf7\u6c42 RN-Debugger \u53f3\u952e  Enable Network Inspect \u5f00\u542f\u76d1\u542c\u7f51\u7edc\u8bf7\u6c42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u89c4\u8303 \u9ed8\u8ba4\u5bb9\u5668\u662f Flex \u5e03\u5c40 Css \u6ca1\u6709\u7ee7\u627f\u4f5c\u7528 Css \u5355\u4f4d\u6ca1\u6709 px \/ vh \/ vw ; \u53ef\u4ee5\u4f1a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[61],"tags":[],"class_list":["post-519","post","type-post","status-publish","format-standard","hentry","category-reactnative"],"_links":{"self":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/posts\/519","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=519"}],"version-history":[{"count":1,"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/posts\/519\/revisions"}],"predecessor-version":[{"id":520,"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/posts\/519\/revisions\/520"}],"wp:attachment":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=519"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=519"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=519"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}