方法一:

创建不同的文件扩展名:

*.android.js*.io.js

方法二:

import { Platform } from 'react-native';if (Platform.OS === 'android') {     // Do something specific for Android   } else if (Platform.OS === 'ios') {     // Handle iOS} marginTop: Platform.OS === 'ios' 10 : 0, paddingBottom: Platform.OS === 'android'   8 : 0

方法三:

const myStyle = Platform.select({ios:{},android:{})const myFn = Platform.select({ios:()=>{},android:()=>{})myFn();

方法四:

if (UIManager.setLayoutAnimationEnabledExperimental) {       UIManager.setLayoutAnimationEnabledExperimental(true);} 

更多相关文章

  1. android Environment 常用方法(获取存储目录)
  2. Android 获取控件宽高的3种方法
  3. Android中创建与几种解析xml的方法!
  4. Android当方法总数超过64K时(Android Studio)
  5. android ViewPager 使用方法
  6. Android 方法数超过64k限制的解决办法
  7. android的Services生命周期和使用方法
  8. Android onClick事件三种实现方法
  9. android学习——android 常见的错误 和 解决方法

随机推荐

  1. reload a div without reloading the who
  2. js获取html下拉框中选中值的自定义属性值
  3. html+css 图片右上角加删除叉,图片删除
  4. HTML DIV百分比宽度奇奇怪怪的间距产生了
  5. seo 优化去掉html 页面的后缀 .html
  6. form在提交时被取消:因为form没有被连接
  7. 使用表单字段值定制CSS属性。
  8. 使用jQuery和AJAX从JSON文件加载数据
  9. XHTML 相对路径与绝对路径
  10. 15个基于WEB的HTML编辑器