我想在我的应用程序中显示 Android 版本(例如 8.0、9.0...)。现在我正在使用:Platform.Version
但这会返回 API 版本(24、25...)。
我想要一个比仅仅创建映射更优雅的选项,并且不需要每次有新的 android 版本时都重新发布。 有没有办法在没有外部库的情况下做到这一点?
最佳答案
你可以:
import { Platform } from 'react-native';
const OsVer = Platform.constants['Release'];
关于javascript - 如何在 React-Native 中获取 Android 版本号? (不是 API 级别编号),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55721289/