React Native: How to Determine if Device is iPhone or iPad

后端 未结 10 846
花落未央
花落未央 2021-02-01 16:32

I know with React Native that we have the ability to determine whether iOS or Android is being run using the Platform module, but how can we determine what device i

10条回答
  •  深忆病人
    2021-02-01 17:26

    I used isTablet() to detect ipad with iphone https://github.com/rebeccahughes/react-native-device-info

    import { isTablet } from 'react-native-device-info';
    if (isTablet()) {
    // try something
    }
    

提交回复
热议问题