├── .gitattributes ├── .gitignore ├── README.md ├── imooc_ReactNative ├── .babelrc ├── .buckconfig ├── .flowconfig ├── .gitattributes ├── .gitignore ├── .watchmanconfig ├── App.js ├── android │ ├── app │ │ ├── BUCK │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── assets │ │ │ └── fonts │ │ │ │ ├── AntDesign.ttf │ │ │ │ ├── Entypo.ttf │ │ │ │ ├── EvilIcons.ttf │ │ │ │ ├── Feather.ttf │ │ │ │ ├── FontAwesome.ttf │ │ │ │ ├── FontAwesome5_Brands.ttf │ │ │ │ ├── FontAwesome5_Regular.ttf │ │ │ │ ├── FontAwesome5_Solid.ttf │ │ │ │ ├── Foundation.ttf │ │ │ │ ├── Ionicons.ttf │ │ │ │ ├── MaterialCommunityIcons.ttf │ │ │ │ ├── MaterialIcons.ttf │ │ │ │ ├── Octicons.ttf │ │ │ │ ├── SimpleLineIcons.ttf │ │ │ │ └── Zocial.ttf │ │ │ ├── java │ │ │ └── com │ │ │ │ └── imooc_reactnative │ │ │ │ ├── MainActivity.java │ │ │ │ └── MainApplication.java │ │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── keystores │ │ ├── BUCK │ │ └── debug.keystore.properties │ └── settings.gradle ├── app.json ├── app │ ├── image │ │ ├── home-active.png │ │ ├── home.png │ │ ├── hot-active.png │ │ ├── hot.png │ │ ├── message-active.png │ │ ├── message.png │ │ ├── my-active.png │ │ └── my.png │ ├── navigation │ │ ├── TopBar.js │ │ └── index.js │ ├── pages │ │ ├── Five.js │ │ ├── Six.js │ │ ├── collection.js │ │ ├── hot.js │ │ ├── my.js │ │ ├── trend.js │ │ └── welcome.js │ └── utils │ │ └── NavigationUtils.js ├── index.js ├── ios │ ├── imooc_ReactNative-tvOS │ │ └── Info.plist │ ├── imooc_ReactNative-tvOSTests │ │ └── Info.plist │ ├── imooc_ReactNative.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ ├── imooc_ReactNative-tvOS.xcscheme │ │ │ └── imooc_ReactNative.xcscheme │ ├── imooc_ReactNative │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Base.lproj │ │ │ └── LaunchScreen.xib │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── Contents.json │ │ ├── Info.plist │ │ └── main.m │ └── imooc_ReactNativeTests │ │ ├── Info.plist │ │ └── imooc_ReactNativeTests.m ├── package.json └── yarn.lock ├── mkDemo ├── .babelrc ├── .buckconfig ├── .flowconfig ├── .gitattributes ├── .gitignore ├── .watchmanconfig ├── App.js ├── android │ ├── app │ │ ├── BUCK │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── assets │ │ │ └── fonts │ │ │ │ ├── AntDesign.ttf │ │ │ │ ├── Entypo.ttf │ │ │ │ ├── EvilIcons.ttf │ │ │ │ ├── Feather.ttf │ │ │ │ ├── FontAwesome.ttf │ │ │ │ ├── FontAwesome5_Brands.ttf │ │ │ │ ├── FontAwesome5_Regular.ttf │ │ │ │ ├── FontAwesome5_Solid.ttf │ │ │ │ ├── Foundation.ttf │ │ │ │ ├── Ionicons.ttf │ │ │ │ ├── MaterialCommunityIcons.ttf │ │ │ │ ├── MaterialIcons.ttf │ │ │ │ ├── Octicons.ttf │ │ │ │ ├── SimpleLineIcons.ttf │ │ │ │ └── Zocial.ttf │ │ │ ├── java │ │ │ └── com │ │ │ │ └── demo │ │ │ │ ├── MainActivity.java │ │ │ │ └── MainApplication.java │ │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── keystores │ │ ├── BUCK │ │ └── debug.keystore.properties │ └── settings.gradle ├── app.json ├── app │ ├── components │ │ └── PopularTab │ │ │ ├── PopularTab.js │ │ │ └── Tabitem.js │ ├── config │ │ └── config.js │ ├── page │ │ ├── Favorite │ │ │ └── Favorite.js │ │ ├── MoreMenu │ │ │ └── MoreMenu.js │ │ ├── My │ │ │ ├── CustomLabel │ │ │ │ └── CustomLabel.js │ │ │ └── My.js │ │ ├── Puplar │ │ │ └── Popular.js │ │ ├── Search │ │ │ └── Search.js │ │ └── Trending │ │ │ └── Trending.js │ ├── public │ │ ├── check.png │ │ └── uncheck.png │ ├── routes │ │ ├── App.js │ │ ├── RouerConfig.js │ │ └── tabBarRoutes │ │ │ └── index.js │ └── utils │ │ ├── Storage.js │ │ ├── data │ │ └── keys.json │ │ └── initData.js ├── index.js ├── ios │ ├── demo-tvOS │ │ └── Info.plist │ ├── demo-tvOSTests │ │ └── Info.plist │ ├── demo.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ ├── demo-tvOS.xcscheme │ │ │ └── demo.xcscheme │ ├── demo │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Base.lproj │ │ │ └── LaunchScreen.xib │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── Contents.json │ │ ├── Info.plist │ │ └── main.m │ └── demoTests │ │ ├── Info.plist │ │ └── demoTests.m ├── package-lock.json ├── package.json └── yarn.lock ├── pinduoduo ├── .babelrc ├── .buckconfig ├── .flowconfig ├── .gitattributes ├── .gitignore ├── .watchmanconfig ├── android │ ├── app │ │ ├── BUCK │ │ ├── build.gradle │ │ ├── libs │ │ │ ├── umeng-common-1.5.1.jar │ │ │ ├── umeng-debug-1.0.0.jar │ │ │ ├── umeng-share-QQ-simplify-6.9.1.jar │ │ │ ├── umeng-share-core-6.9.1.jar │ │ │ ├── umeng-share-sina-simplify-6.9.1.jar │ │ │ ├── umeng-share-wechat-simplify-6.9.1.jar │ │ │ └── umeng-sharetool-6.9.1.jar │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── assets │ │ │ └── fonts │ │ │ │ ├── AntDesign.ttf │ │ │ │ ├── Entypo.ttf │ │ │ │ ├── EvilIcons.ttf │ │ │ │ ├── Feather.ttf │ │ │ │ ├── FontAwesome.ttf │ │ │ │ ├── FontAwesome5_Brands.ttf │ │ │ │ ├── FontAwesome5_Regular.ttf │ │ │ │ ├── FontAwesome5_Solid.ttf │ │ │ │ ├── Foundation.ttf │ │ │ │ ├── Ionicons.ttf │ │ │ │ ├── MaterialCommunityIcons.ttf │ │ │ │ ├── MaterialIcons.ttf │ │ │ │ ├── Octicons.ttf │ │ │ │ ├── SimpleLineIcons.ttf │ │ │ │ └── Zocial.ttf │ │ │ ├── java │ │ │ └── com │ │ │ │ └── pinduoduo │ │ │ │ ├── MainActivity.java │ │ │ │ ├── MainApplication.java │ │ │ │ └── module │ │ │ │ ├── ShareModule.java │ │ │ │ ├── SharePackage.java │ │ │ │ └── utils │ │ │ │ └── BitMapUtil.java │ │ │ ├── res │ │ │ ├── drawable-hdpi │ │ │ │ └── splash.png │ │ │ ├── drawable-mdpi │ │ │ │ └── splash.png │ │ │ ├── drawable-xhdpi │ │ │ │ └── splash.png │ │ │ ├── drawable-xxhdpi │ │ │ │ └── splash.png │ │ │ ├── drawable-xxxhdpi │ │ │ │ └── splash.png │ │ │ ├── layout │ │ │ │ └── launch_screen.xml │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ └── wxapi │ │ │ └── WXEntryActivity.java │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── keystores │ │ ├── BUCK │ │ └── debug.keystore.properties │ └── settings.gradle ├── app.json ├── app │ ├── components │ │ ├── Welcome.js │ │ └── base.js │ ├── public │ │ └── images │ │ │ └── Home │ │ │ └── Popular │ │ │ ├── 08e1f8db7f6c9ce11f546cc05c9176ce.webp │ │ │ ├── 0ad6a91690c74dedf124d06e8ef51b5f.webp │ │ │ ├── 0c17288d4a879610343eae586fabbc70.webp │ │ │ ├── 152611d19c6d53f94220d06b02a4d75e.webp │ │ │ ├── 1bbff73a685197888f2b0805dc2a2df8.gif │ │ │ ├── 23e66d95e126bac54960f8b58c60022b.webp │ │ │ ├── 26c916947489c6b2ddd188ecdb54fd8d.webp │ │ │ ├── 4ad66f8d7d28d6237a9f25b9a6d19f3e.webp │ │ │ ├── 54958a7298eb208b54dd4d4d0dcac55b.jpg │ │ │ ├── 5c0c9d938b49cc18fa1b77b3d4eaca56.webp │ │ │ ├── 67c60a1882411f9fc45765a0f7406141.webp │ │ │ ├── 6ee7aa359a495098f7c67af813e35f18.webp │ │ │ ├── 864e35ace6c3c090ec8121e05c7b0604.webp │ │ │ ├── 896a52a854723aa5f4e0406d9b7149e1.png │ │ │ ├── 92498f7f180eb07547f0d1735b7203c8.webp │ │ │ ├── 9281dd01fa3c88cedf5164d77384c6b2.webp │ │ │ ├── 96f2dca329442071e7745f7831b7dbd1.jpg │ │ │ ├── 994635c2294e4d5acd768d796b4cd7b6.webp │ │ │ ├── a666ac01e718dd06231a722baa6fa935.webp │ │ │ ├── activityPhoto.png │ │ │ ├── c2ba677bcd16ecad6c335e5e04a1cf1e.webp │ │ │ ├── c671f2c49805658697cc0f72fff87eb3.webp │ │ │ ├── cce88276d606e3f3115ee26d6a380d13.webp │ │ │ ├── d20eead7a6ffb6a7309707cf6ec0f97f.webp │ │ │ ├── deddd05761d7a5709521c690810af417.webp │ │ │ ├── e1ecb559c183e2443b8c1866e708366e.webp │ │ │ ├── edcaa84386e49f5854244c2b565bf075.webp │ │ │ └── topbuttom.png │ ├── routes │ │ ├── App.js │ │ ├── RouterConfig.js │ │ ├── tabBarRouter.js │ │ └── tabBars │ │ │ └── Home.js │ ├── share │ │ ├── SharePlatform.js │ │ └── share.js │ ├── src │ │ ├── chatWith │ │ │ └── IM.js │ │ ├── home │ │ │ ├── Car │ │ │ │ └── Car.js │ │ │ ├── Device │ │ │ │ └── Device.js │ │ │ ├── Food │ │ │ │ └── Food.js │ │ │ ├── Motion │ │ │ │ └── Motion.js │ │ │ ├── Phone │ │ │ │ └── Phone.js │ │ │ ├── Popular │ │ │ │ ├── Popular.js │ │ │ │ ├── components │ │ │ │ │ ├── menu.js │ │ │ │ │ ├── stopList.js │ │ │ │ │ ├── swiper.js │ │ │ │ │ └── topButtonShow.js │ │ │ │ └── store │ │ │ │ │ ├── actionCreators.js │ │ │ │ │ ├── actionTypes.js │ │ │ │ │ ├── index.js │ │ │ │ │ └── reducer.js │ │ │ ├── Shoe │ │ │ │ └── Shoe.js │ │ │ ├── Store │ │ │ │ └── Store.js │ │ │ └── Woman │ │ │ │ └── Woman.js │ │ ├── productDetails │ │ │ └── ProductDetails.js │ │ └── tabBar │ │ │ ├── ChatWith.js │ │ │ ├── Home.js │ │ │ ├── Personal.js │ │ │ ├── Recommend.js │ │ │ └── Search.js │ ├── store │ │ ├── actionCreators.js │ │ ├── actionTypes.js │ │ ├── index.js │ │ └── reducer.js │ └── utils │ │ ├── index.js │ │ └── response.js ├── index.js ├── ios │ ├── pinduoduo-tvOS │ │ └── Info.plist │ ├── pinduoduo-tvOSTests │ │ └── Info.plist │ ├── pinduoduo.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ ├── pinduoduo-tvOS.xcscheme │ │ │ └── pinduoduo.xcscheme │ ├── pinduoduo │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Base.lproj │ │ │ └── LaunchScreen.xib │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── Contents.json │ │ ├── Info.plist │ │ └── main.m │ └── pinduoduoTests │ │ ├── Info.plist │ │ └── pinduoduoTests.m ├── package-lock.json ├── package.json └── yarn.lock └── planned_project ├── .babelrc ├── .buckconfig ├── .flowconfig ├── .gitattributes ├── .gitignore ├── .watchmanconfig ├── App.js ├── LICENSE ├── README.md ├── android ├── app │ ├── BUCK │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── planned_project │ │ │ ├── MainActivity.java │ │ │ └── MainApplication.java │ │ └── res │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── strings.xml │ │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── keystores │ ├── BUCK │ └── debug.keystore.properties └── settings.gradle ├── app.json ├── app ├── Common │ ├── Icon.js │ ├── Image.js │ ├── TabBar-beta.js │ ├── TabBar.js │ └── TabHeader.js ├── Image │ └── public │ │ ├── back-write.png │ │ ├── back.png │ │ ├── colse.png │ │ ├── home.png │ │ ├── homeActive.png │ │ ├── menu-icon.png │ │ ├── my.png │ │ ├── myActive.png │ │ ├── shezhi.png │ │ ├── shopping.png │ │ ├── shoppingActive.png │ │ ├── sort.png │ │ ├── sortActive.png │ │ └── wenz.png ├── Routes │ ├── Router.js │ ├── RouterConfig.js │ ├── TabBar │ │ ├── Category.js │ │ ├── Main.js │ │ ├── My.js │ │ └── OrderList.js │ └── TabBarRouter.js ├── Utils │ └── Storage.js └── View │ ├── My │ └── Registry │ │ └── Registry.js │ └── TabBar │ ├── Category │ └── Category.js │ ├── Main │ └── Main.js │ ├── My │ └── My.js │ ├── OnlineDoctor │ └── OnlineDoctor.js │ └── OrderList │ └── OrderList.js ├── index.js ├── ios ├── planned_project-tvOS │ └── Info.plist ├── planned_project-tvOSTests │ └── Info.plist ├── planned_project.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── planned_project-tvOS.xcscheme │ │ └── planned_project.xcscheme ├── planned_project │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ └── LaunchScreen.xib │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ ├── Info.plist │ └── main.m └── planned_projectTests │ ├── Info.plist │ └── planned_projectTests.m ├── package.json └── yarn.lock /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | 33 | # node.js 34 | # 35 | node_modules/ 36 | npm-debug.log 37 | yarn-error.log 38 | 39 | # BUCK 40 | buck-out/ 41 | \.buckd/ 42 | *.keystore 43 | 44 | # fastlane 45 | # 46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 47 | # screenshots whenever they are needed. 48 | # For more information about the recommended setup visit: 49 | # https://docs.fastlane.tools/best-practices/source-control/ 50 | 51 | */fastlane/report.xml 52 | */fastlane/Preview.html 53 | */fastlane/screenshots 54 | 55 | # Bundle artifact 56 | *.jsbundle 57 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # RN 2 | 3 | > 仿照拼多多的一个 RNapp 4 | 5 | ![](http://www.vkcyan.top/FuLs73Rn5orX4MMFU9ilFCmDift1.jpg) 6 | 7 | 8 | 9 | ### 几乎必备的插件 10 | 11 | React Navigation 3.x 顺带安装RN的图标库 12 | 13 | ```bash 14 | yarn add react-navigation // RN导航库 15 | yarn add react-native-gesture-handler // RN 导航库依赖 16 | npm install react-native-vector-icons --save //图标库 17 | npm install react-navigation-material-bottom-tabs react-native-paper // 懒加载底部路由 18 | npm install react-native-splash-screen --save // 启动页面 解决闪屏问题 19 | npm install axios --save 20 | react-native link 21 | ``` 22 | 23 | > react-native link 我的理解是 将 这个库中的底层代码与android IOS系统做连接,类似于 "注册" 吧 24 | 25 | 26 | 27 | ### 使用redux的需要安装的全部插件 28 | 29 | ```bash 30 | npm install redux --save 31 | npm install react-redux --save 32 | npm install immutable --save 33 | npm install redux-thunk --save 34 | ``` 35 | 36 | ### 解决打开APP闪屏问题 37 | 38 | 解决闪屏问题插件,我先使用的是`rn-splash-screen`,开发环境没有问题,但是打包总是失败,后面就换了[**react-native-splash-screen**](https://github.com/crazycodeboy/react-native-splash-screen),这个 测试 打包都可以 不过 使用上比前者复杂一点 39 | 40 | 41 | 42 | ### 定位服务 43 | 44 | 感觉定位插件,选择很多样,我也是没怎么挑选,使用了[react-native-amap-geolocatio](https://github.com/qiuxiang/react-native-amap-geolocation) 45 | 46 | 47 | 48 | ### 第三方集成 49 | 50 | > 例如 分享到 qq 微信 朋友圈 以及第三方登录等等 51 | 52 | 使用**友盟**完成的第三方集成[react-native-share](https://github.com/songxiaoliang/react-native-share) 53 | 54 | 55 | 56 | ### 消息推送 57 | 58 | 消息推送使用的是 **极光推送** [jpush-react-native](https://github.com/jpush/jpush-react-native) 59 | 60 | 61 | 62 | ### IM聊天 63 | 64 | [react-native-gifted-chat](https://github.com/FaridSafi/react-native-gifted-chat) 65 | 66 | [aurora-imui](https://github.com/jpush/aurora-imui/blob/master/README_zh.md) 2选一 67 | 68 | 69 | 70 | ### 相关文章 71 | 72 | [RN配置沉浸式状态栏]() 73 | 74 | [React-Native项目中使用Redux](https://www.cnblogs.com/wuvkcyan/p/10081874.html) 75 | 76 | [React-Native使用极光进行消息推送](https://github.com/vkcyan/text/blob/master/react/React-Native%E4%BD%BF%E7%94%A8%E6%9E%81%E5%85%89%E8%BF%9B%E8%A1%8C%E6%B6%88%E6%81%AF%E6%8E%A8%E9%80%81.md) 77 | 78 | -------------------------------------------------------------------------------- /imooc_ReactNative/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["module:metro-react-native-babel-preset"] 3 | } 4 | -------------------------------------------------------------------------------- /imooc_ReactNative/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /imooc_ReactNative/.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /imooc_ReactNative/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | 33 | # node.js 34 | # 35 | node_modules/ 36 | npm-debug.log 37 | yarn-error.log 38 | 39 | # BUCK 40 | buck-out/ 41 | \.buckd/ 42 | *.keystore 43 | 44 | # fastlane 45 | # 46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 47 | # screenshots whenever they are needed. 48 | # For more information about the recommended setup visit: 49 | # https://docs.fastlane.tools/best-practices/source-control/ 50 | 51 | */fastlane/report.xml 52 | */fastlane/Preview.html 53 | */fastlane/screenshots 54 | 55 | # Bundle artifact 56 | *.jsbundle 57 | -------------------------------------------------------------------------------- /imooc_ReactNative/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /imooc_ReactNative/App.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { View, StatusBar, Platform } from 'react-native' 3 | import Navigation from './app/navigation' 4 | 5 | export default class App extends Component { 6 | componentDidMount() { 7 | console.log(Platform.OS) 8 | console.log(StatusBar.currentHeight) 9 | StatusBar.setTranslucent(true) 10 | if (Platform.OS == 'android') { 11 | // Storage.setStorage('TabHeight', StatusBar.currentHeight.toString()) 12 | } else { 13 | // console.log('苹果手机等待适配') 14 | } 15 | StatusBar.setBackgroundColor('rgba(0,0,0,0.4)') 16 | StatusBar.setBarStyle('dark-content') 17 | 18 | } 19 | render() { 20 | return 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /imooc_ReactNative/android/app/BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | lib_deps = [] 12 | 13 | for jarfile in glob(['libs/*.jar']): 14 | name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')] 15 | lib_deps.append(':' + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | 21 | for aarfile in glob(['libs/*.aar']): 22 | name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')] 23 | lib_deps.append(':' + name) 24 | android_prebuilt_aar( 25 | name = name, 26 | aar = aarfile, 27 | ) 28 | 29 | android_library( 30 | name = "all-libs", 31 | exported_deps = lib_deps, 32 | ) 33 | 34 | android_library( 35 | name = "app-code", 36 | srcs = glob([ 37 | "src/main/java/**/*.java", 38 | ]), 39 | deps = [ 40 | ":all-libs", 41 | ":build_config", 42 | ":res", 43 | ], 44 | ) 45 | 46 | android_build_config( 47 | name = "build_config", 48 | package = "com.imooc_reactnative", 49 | ) 50 | 51 | android_resource( 52 | name = "res", 53 | package = "com.imooc_reactnative", 54 | res = "src/main/res", 55 | ) 56 | 57 | android_binary( 58 | name = "app", 59 | keystore = "//android/keystores:debug", 60 | manifest = "src/main/AndroidManifest.xml", 61 | package_type = "debug", 62 | deps = [ 63 | ":app-code", 64 | ], 65 | ) 66 | -------------------------------------------------------------------------------- /imooc_ReactNative/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /imooc_ReactNative/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 13 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /imooc_ReactNative/android/app/src/main/assets/fonts/AntDesign.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/assets/fonts/AntDesign.ttf -------------------------------------------------------------------------------- /imooc_ReactNative/android/app/src/main/assets/fonts/Entypo.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/assets/fonts/Entypo.ttf -------------------------------------------------------------------------------- /imooc_ReactNative/android/app/src/main/assets/fonts/EvilIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/assets/fonts/EvilIcons.ttf -------------------------------------------------------------------------------- /imooc_ReactNative/android/app/src/main/assets/fonts/Feather.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/assets/fonts/Feather.ttf -------------------------------------------------------------------------------- /imooc_ReactNative/android/app/src/main/assets/fonts/FontAwesome.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/assets/fonts/FontAwesome.ttf -------------------------------------------------------------------------------- /imooc_ReactNative/android/app/src/main/assets/fonts/FontAwesome5_Brands.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/assets/fonts/FontAwesome5_Brands.ttf -------------------------------------------------------------------------------- /imooc_ReactNative/android/app/src/main/assets/fonts/FontAwesome5_Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/assets/fonts/FontAwesome5_Regular.ttf -------------------------------------------------------------------------------- /imooc_ReactNative/android/app/src/main/assets/fonts/FontAwesome5_Solid.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/assets/fonts/FontAwesome5_Solid.ttf -------------------------------------------------------------------------------- /imooc_ReactNative/android/app/src/main/assets/fonts/Foundation.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/assets/fonts/Foundation.ttf -------------------------------------------------------------------------------- /imooc_ReactNative/android/app/src/main/assets/fonts/Ionicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/assets/fonts/Ionicons.ttf -------------------------------------------------------------------------------- /imooc_ReactNative/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf -------------------------------------------------------------------------------- /imooc_ReactNative/android/app/src/main/assets/fonts/MaterialIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/assets/fonts/MaterialIcons.ttf -------------------------------------------------------------------------------- /imooc_ReactNative/android/app/src/main/assets/fonts/Octicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/assets/fonts/Octicons.ttf -------------------------------------------------------------------------------- /imooc_ReactNative/android/app/src/main/assets/fonts/SimpleLineIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/assets/fonts/SimpleLineIcons.ttf -------------------------------------------------------------------------------- /imooc_ReactNative/android/app/src/main/assets/fonts/Zocial.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/assets/fonts/Zocial.ttf -------------------------------------------------------------------------------- /imooc_ReactNative/android/app/src/main/java/com/imooc_reactnative/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.imooc_reactnative; 2 | 3 | import com.facebook.react.ReactActivity; 4 | 5 | public class MainActivity extends ReactActivity { 6 | 7 | /** 8 | * Returns the name of the main component registered from JavaScript. 9 | * This is used to schedule rendering of the component. 10 | */ 11 | @Override 12 | protected String getMainComponentName() { 13 | return "imooc_ReactNative"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /imooc_ReactNative/android/app/src/main/java/com/imooc_reactnative/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.imooc_reactnative; 2 | 3 | import android.app.Application; 4 | 5 | import com.facebook.react.ReactApplication; 6 | import com.oblador.vectoricons.VectorIconsPackage; 7 | import com.swmansion.gesturehandler.react.RNGestureHandlerPackage; 8 | import com.facebook.react.ReactNativeHost; 9 | import com.facebook.react.ReactPackage; 10 | import com.facebook.react.shell.MainReactPackage; 11 | import com.facebook.soloader.SoLoader; 12 | 13 | import java.util.Arrays; 14 | import java.util.List; 15 | 16 | public class MainApplication extends Application implements ReactApplication { 17 | 18 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 19 | @Override 20 | public boolean getUseDeveloperSupport() { 21 | return BuildConfig.DEBUG; 22 | } 23 | 24 | @Override 25 | protected List getPackages() { 26 | return Arrays.asList( 27 | new MainReactPackage(), 28 | new VectorIconsPackage(), 29 | new RNGestureHandlerPackage() 30 | ); 31 | } 32 | 33 | @Override 34 | protected String getJSMainModuleName() { 35 | return "index"; 36 | } 37 | }; 38 | 39 | @Override 40 | public ReactNativeHost getReactNativeHost() { 41 | return mReactNativeHost; 42 | } 43 | 44 | @Override 45 | public void onCreate() { 46 | super.onCreate(); 47 | SoLoader.init(this, /* native exopackage */ false); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /imooc_ReactNative/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /imooc_ReactNative/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /imooc_ReactNative/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /imooc_ReactNative/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /imooc_ReactNative/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /imooc_ReactNative/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /imooc_ReactNative/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /imooc_ReactNative/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /imooc_ReactNative/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /imooc_ReactNative/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /imooc_ReactNative/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | imooc_ReactNative 3 | 4 | -------------------------------------------------------------------------------- /imooc_ReactNative/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /imooc_ReactNative/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext { 5 | buildToolsVersion = "27.0.3" 6 | minSdkVersion = 16 7 | compileSdkVersion = 27 8 | targetSdkVersion = 26 9 | supportLibVersion = "27.1.1" 10 | } 11 | repositories { 12 | google() 13 | jcenter() 14 | } 15 | dependencies { 16 | classpath 'com.android.tools.build:gradle:3.1.4' 17 | 18 | // NOTE: Do not place your application dependencies here; they belong 19 | // in the individual module build.gradle files 20 | } 21 | } 22 | 23 | allprojects { 24 | repositories { 25 | mavenLocal() 26 | google() 27 | jcenter() 28 | maven { 29 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 30 | url "$rootDir/../node_modules/react-native/android" 31 | } 32 | } 33 | } 34 | 35 | 36 | task wrapper(type: Wrapper) { 37 | gradleVersion = '4.4' 38 | distributionUrl = distributionUrl.replace("bin", "all") 39 | } 40 | -------------------------------------------------------------------------------- /imooc_ReactNative/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | -------------------------------------------------------------------------------- /imooc_ReactNative/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /imooc_ReactNative/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip 6 | -------------------------------------------------------------------------------- /imooc_ReactNative/android/keystores/BUCK: -------------------------------------------------------------------------------- 1 | keystore( 2 | name = "debug", 3 | properties = "debug.keystore.properties", 4 | store = "debug.keystore", 5 | visibility = [ 6 | "PUBLIC", 7 | ], 8 | ) 9 | -------------------------------------------------------------------------------- /imooc_ReactNative/android/keystores/debug.keystore.properties: -------------------------------------------------------------------------------- 1 | key.store=debug.keystore 2 | key.alias=androiddebugkey 3 | key.store.password=android 4 | key.alias.password=android 5 | -------------------------------------------------------------------------------- /imooc_ReactNative/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'imooc_ReactNative' 2 | include ':react-native-vector-icons' 3 | project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android') 4 | include ':react-native-gesture-handler' 5 | project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android') 6 | 7 | include ':app' 8 | -------------------------------------------------------------------------------- /imooc_ReactNative/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "imooc_ReactNative", 3 | "displayName": "imooc_ReactNative" 4 | } -------------------------------------------------------------------------------- /imooc_ReactNative/app/image/home-active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/app/image/home-active.png -------------------------------------------------------------------------------- /imooc_ReactNative/app/image/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/app/image/home.png -------------------------------------------------------------------------------- /imooc_ReactNative/app/image/hot-active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/app/image/hot-active.png -------------------------------------------------------------------------------- /imooc_ReactNative/app/image/hot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/app/image/hot.png -------------------------------------------------------------------------------- /imooc_ReactNative/app/image/message-active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/app/image/message-active.png -------------------------------------------------------------------------------- /imooc_ReactNative/app/image/message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/app/image/message.png -------------------------------------------------------------------------------- /imooc_ReactNative/app/image/my-active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/app/image/my-active.png -------------------------------------------------------------------------------- /imooc_ReactNative/app/image/my.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/app/image/my.png -------------------------------------------------------------------------------- /imooc_ReactNative/app/navigation/TopBar.js: -------------------------------------------------------------------------------- 1 | import { 2 | createAppContainer, 3 | createMaterialTopTabNavigator 4 | } from 'react-navigation' 5 | import One from '../pages/hot' 6 | import Four from '../pages/my' 7 | 8 | export default createAppContainer( 9 | createMaterialTopTabNavigator( 10 | { 11 | One: { 12 | screen: Four, // 配置页面 13 | navigationOptions: { 14 | tabBarLabel: 'One' 15 | } 16 | }, 17 | Four: { 18 | screen: Four, 19 | navigationOptions: { 20 | tabBarLabel: 'Four' 21 | } 22 | } 23 | }, 24 | { 25 | initialRouteName: 'One', 26 | lazy: true, 27 | tabBarPosition: 'top', 28 | optimizationsEnabled: true, // 时候将Tab也嵌套到页面中,如果是改tab也失去焦点,将会被移除当前页,提高内存使用率 29 | tabBarOptions: { 30 | scrollEnabled: true, 31 | upperCaseLabel: false, // 是否大写 32 | activeTintColor: 'red', // 活动选项卡 33 | inactiveTintColor: 'red', // "非活动" 选项卡 34 | tabStyle: { 35 | paddingBottom: 4 36 | }, 37 | pressColor: 'gray', // 添加点击动效 38 | style: { 39 | backgroundColor: 'white' // 头部导航栏样式 40 | }, 41 | indicatorStyle: { 42 | backgroundColor: 'red' // 指示器样式 43 | } 44 | } 45 | } 46 | ) 47 | ) 48 | -------------------------------------------------------------------------------- /imooc_ReactNative/app/pages/Five.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { Text, View, Button } from 'react-native' 3 | 4 | export default class Five extends Component { 5 | render() { 6 | return ( 7 | 8 | Five页面 9 |