react native 导入第三方连接库,Orientation.h file is not found
2016-11-17 09:03
591 查看
正确的执行步骤
1>npm install --save react-native-orientation
2>react-native link 自动将project和.a文件导入你的xcode 项目中,不需要手动导入
3>bulild,编译运行
iOS:
1.用Xcode打开项目,右键点击项目名称,选择 “Add Files to ‘项目名’ “ ;
2.找到路径文件: 项目文件夹/node_modules/react-native-orientation/RCTOrientation ,将该文件添加上;
3.然后重新运行项目;
Android:
返回的结果有
返回的结果有
参考:
http://facebook.github.io/react-native/docs/linking-libraries-ios.html#step-3
https://github.com/yamill/react-native-orientation
1>npm install --save react-native-orientation
2>react-native link 自动将project和.a文件导入你的xcode 项目中,不需要手动导入
3>bulild,编译运行
iOS:
1.用Xcode打开项目,右键点击项目名称,选择 “Add Files to ‘项目名’ “ ;
2.找到路径文件: 项目文件夹/node_modules/react-native-orientation/RCTOrientation ,将该文件添加上;
3.然后重新运行项目;
Android:
用法
componentWillMount() { // 判断横竖屏幕 var initial = Orientation.getInitialOrientation(); if (initial === 'PORTRAIT') { //do stuff } else { //do other stuff } // 只允许竖屏 Orientation.lockToPortrait(); //只允许横屏 Orientation.lockToLandscape(); } |
Functions
lockToPortrait()
lockToLandscape()
lockToLandscapeLeft()
lockToLandscapeRight()
unlockAllOrientations()
getOrientation(function(err, orientation)
返回的结果有
LANDSCAPE
PORTRAIT
UNKNOWN
PORTRAITUPSIDEDOWN
getSpecificOrientation(function(err, specificOrientation)
返回的结果有
LANDSCAPE-LEFT
LANDSCAPE-RIGHT
PORTRAIT
UNKNOWN
PORTRAITUPSIDEDOWN
参考:
http://facebook.github.io/react-native/docs/linking-libraries-ios.html#step-3
https://github.com/yamill/react-native-orientation
相关文章推荐
- React Native 'boost/iterator/iterator_adaptor.hpp' file not found’解决方案
- iOS常见错误3-Xcode导入第三方库 'MAMapKit/MAMapKit.h' file not found('XXXX/XXXX.h' file not found)错误
- Cocoapods 添加第三方,导入不了头文件或者 not found file
- React Native 日常报错 'config.h' file not found
- ReactNative出现错误问题'React/RCTBridgeModule.h' file not found
- ios react native 手动配置 realm 使用cocoapods 会编译报错 fatal error: 'React/RCTBridge.h' file not found
- React-Native 'RCTRootView.h' file not found AppDelegate.m
- [React-native] 报React/RCTBridgeModule.h' file not found
- ReactNative Ios报出 'React/RCTBundleURLProvider.h' file not found错误
- React-Native 'RCTRootView.h' file not found AppDelegate.m
- nested exception is java.io.FileNotFoundException: class path resource [applicationContext.xml] cann
- hadoop 问题 copyFromLocal: java.io.FileNotFoundException: Parent path is not a directory: /user/admini
- ERROR! MySQL is running but PID file could not be found ?
- Eclipse导入Gradle时报错:SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable
- 将MySQL数据库搬迁到另一服务器中遇到的问题:MySQL is running but PID file could not be found[FAILED]&MySQL大小写
- mysql导入数据file not found解决方案
- Invocation of init method failed; nested exception is java.io.FileNotFoundException: class path reso
- 连接sde服务报错"Entry for SDE instance not found in services file”
- 解决java web项目导入后出现的问题 ---cannot be read or is not a valid ZIP file
- suse 11安装db2时The 32-bit library file libpam.so is not found on the system.