1. <small id='UuK2j'></small><noframes id='UuK2j'>

    <legend id='UuK2j'><style id='UuK2j'><dir id='UuK2j'><q id='UuK2j'></q></dir></style></legend>

      <bdo id='UuK2j'></bdo><ul id='UuK2j'></ul>
  2. <tfoot id='UuK2j'></tfoot>
    <i id='UuK2j'><tr id='UuK2j'><dt id='UuK2j'><q id='UuK2j'><span id='UuK2j'><b id='UuK2j'><form id='UuK2j'><ins id='UuK2j'></ins><ul id='UuK2j'></ul><sub id='UuK2j'></sub></form><legend id='UuK2j'></legend><bdo id='UuK2j'><pre id='UuK2j'><center id='UuK2j'></center></pre></bdo></b><th id='UuK2j'></th></span></q></dt></tr></i><div id='UuK2j'><tfoot id='UuK2j'></tfoot><dl id='UuK2j'><fieldset id='UuK2j'></fieldset></dl></div>

    1. REACT NATIVE:有办法识别设备类型(智能手机、平板电脑、笔记本电脑)吗?

      REACT NATIVE : There is way to identify a device type (smartphone, tablet, laptop)?(REACT NATIVE:有办法识别设备类型(智能手机、平板电脑、笔记本电脑)吗?)

      <tfoot id='rfZjA'></tfoot>
        • <bdo id='rfZjA'></bdo><ul id='rfZjA'></ul>

                <tbody id='rfZjA'></tbody>
              <legend id='rfZjA'><style id='rfZjA'><dir id='rfZjA'><q id='rfZjA'></q></dir></style></legend>

            1. <i id='rfZjA'><tr id='rfZjA'><dt id='rfZjA'><q id='rfZjA'><span id='rfZjA'><b id='rfZjA'><form id='rfZjA'><ins id='rfZjA'></ins><ul id='rfZjA'></ul><sub id='rfZjA'></sub></form><legend id='rfZjA'></legend><bdo id='rfZjA'><pre id='rfZjA'><center id='rfZjA'></center></pre></bdo></b><th id='rfZjA'></th></span></q></dt></tr></i><div id='rfZjA'><tfoot id='rfZjA'></tfoot><dl id='rfZjA'><fieldset id='rfZjA'></fieldset></dl></div>

                <small id='rfZjA'></small><noframes id='rfZjA'>

                本文介绍了REACT NATIVE:有办法识别设备类型(智能手机、平板电脑、笔记本电脑)吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                有办法识别设备类型(智能手机、平板电脑、笔记本电脑)吗?我需要将设备类型识别为:智能手机、平板电脑、笔记本电脑..我尝试使用 react-native-device-info" api 库,但不明白如何识别 3 种特定设备类型(智能手机、平板电脑、笔记本电脑).

                There is way to identify a device type (smartphone, tablet, laptop) ? I need to identify a device type as: smartphone, tablet, laptop .. i try to use the "react-native-device-info" api library but dont understand how to identify the 3 specific devices type (smartphone, tablet, laptop) .

                那么,如果它的Handset"=>,我怎么能做一些代码给我呢?智能手机,如果它的未知"=>笔记本电脑/计算机,它也会保存在我的异步存储中.

                So how can i do some code that will gives me if its "Handset"=> Smartphone , if its "unknown"=> Laptop/Computer and it will be saved as well in my async-storage.

                import DeviceInfo from 'react-native-device-info';
                import AsyncStorage from '@react-native-community/async-storage';
                
                // how can i do some code that will gives me if its "Handset"=> Smartphone , 
                //if its "unknown"=> Laptop/Computer 
                //and it will be saved as well in my async-storage.
                
                //this some example that i wanna get it works well coz now its not work good
                
                const funct1=  (type) => {
                let type = DeviceInfo.getDeviceType();
                
                if type==='Handset'{
                  AsyncStorage.setItem('PLATFORM-TYPE', 'Smartphone');
                }
                if type==='unknown'{
                  AsyncStorage.setItem('PLATFORM-TYPE', 'Laptop/Computer');
                }
                };
                

                推荐答案

                根据API DOC 您可以使用这些 API 来检测设备类型:

                According to API DOC you can use these APIs to detect the device types:

                • getDeviceType
                • isTablet
                • isEmulator
                • getModel

                有很多 API 可以获取设备名称或任何其他用例.阅读 API 文档 :) 据我所知,您无法检测到 laptop,React Native 不适用于 PC.

                There are so many APIs to get the device name or any other use-cases. Read the API doc :) Also you cannot detect the laptop as far as I know, React Native does not for on PC.

                这篇关于REACT NATIVE:有办法识别设备类型(智能手机、平板电脑、笔记本电脑)吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Gradient Button to background-color blinks on hover(悬停时背景颜色的渐变按钮闪烁)
                How to make hovering over active button not use hover effect?(如何使悬停在活动按钮上不使用悬停效果?)
                html javascript show image hover(html javascript 显示图像悬停)
                How to get css hover values on click?(如何在点击时获得 css 悬停值?)
                Change background image on link hover(更改链接悬停时的背景图像)
                Highlight multiple items on hover#39;s condition(突出显示悬停条件下的多个项目)
                <i id='kudLf'><tr id='kudLf'><dt id='kudLf'><q id='kudLf'><span id='kudLf'><b id='kudLf'><form id='kudLf'><ins id='kudLf'></ins><ul id='kudLf'></ul><sub id='kudLf'></sub></form><legend id='kudLf'></legend><bdo id='kudLf'><pre id='kudLf'><center id='kudLf'></center></pre></bdo></b><th id='kudLf'></th></span></q></dt></tr></i><div id='kudLf'><tfoot id='kudLf'></tfoot><dl id='kudLf'><fieldset id='kudLf'></fieldset></dl></div>

                <small id='kudLf'></small><noframes id='kudLf'>

                    <bdo id='kudLf'></bdo><ul id='kudLf'></ul>

                        <tfoot id='kudLf'></tfoot>

                          <tbody id='kudLf'></tbody>
                      • <legend id='kudLf'><style id='kudLf'><dir id='kudLf'><q id='kudLf'></q></dir></style></legend>