简体   繁体   English

反应原生目标三星 Galaxy S7

[英]React native target Samsung Galaxy S7

My styling is broken on Samsung Galaxy S7 - I am using react-native-device-info is there a way I can target the Samsung S7 so I can conditionally set the styling?我的样式在三星 Galaxy S7 上被破坏了 - 我正在使用react-native-device-info有没有办法可以针对三星 S7 以便有条件地设置样式?

When I try and use DeviceInfo.getDeviceId() and my emulator it gives me Ùnknown当我尝试使用DeviceInfo.getDeviceId()和我的模拟器时,它给了我Ùnknown

import DeviceInfo from "react-native-device-info";
DeviceInfo.getDeviceId() //unknown

Any ideas?有任何想法吗?

With the code below you will get the get the name of the cellphone, in your case, Samsumg Galaxy S7:使用下面的代码,您将获得手机的名称,在您的情况下,Samsumg Galaxy S7:

import DeviceInfo from "react-native-device-info";
DeviceInfo.getModel()

Please thumbs up if my answer is correct, waiting for your feedback:).如果我的回答是正确的,请点赞,等待您的反馈:)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM