ios - 如何在 IOS(React Native) 中创建像 android 一样的两个 Activity?

标签 ios react-native

我想制作一个应用程序,该应用程序将在 IOS(React Native)中具有两个具有不同应用程序启动图标的 Activity。

我在 Android 中做了这个。代码如下。

      <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
        android:windowSoftInputMode="adjustResize">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
      </activity>

      <activity
        android:name=".NotifierActivity"
        android:label="SOS"
        android:icon="@mipmap/ic_launcher_sos"
        android:roundIcon="@mipmap/ic_launcher_sos_round"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
        android:windowSoftInputMode="adjustResize">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
      </activity>

我是初学者。所以,我非常需要你的帮助。

最佳答案

An example for mainfest, Let me know if you are seeking for more help. You need to add this in app/AndroidManifest.xml

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.xxx">

        <uses-permission android:name="android.permission.INTERNET" />
        <uses-permission android:name="android.permission.CAMERA" />
        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
        <application
            android:name=".MainApplication"
            android:label="@string/app_name"
            android:icon="@mipmap/ic_launcher"
            android:allowBackup="false"
            android:theme="@style/AppTheme"
            android:hardwareAccelerated="true"
            android:largeHeap="true"
            android:usesCleartextTraffic="true"
            >
        <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
        android:windowSoftInputMode="adjustResize">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
      </activity>

      <activity
        android:name=".NotifierActivity"
        android:label="SOS"
        android:icon="@mipmap/ic_launcher_sos"
        android:roundIcon="@mipmap/ic_launcher_sos_round"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
        android:windowSoftInputMode="adjustResize">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
      </activity>
</application>
</manifest>

关于ios - 如何在 IOS(React Native) 中创建像 android 一样的两个 Activity?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58948714/

相关文章:

javascript - react 子 JSX 元素不从父级继承

ios - 为什么初始化为 `weak` 在 Swift 中返回 `nil`?

ios - 更新到 Xcode 10.2.1 后出现数百个警告。发布到App store还可以吗?

react-native - 在React-Native中解析存储在AsyncStorage中的JSON数据

ios - react native 错误 : EMFILE: too many open files, watch

reactjs - React native 中的未知模块 "Firebase"

javascript - 如何创建一个 react native 全屏模式,它将覆盖带有选项卡的 SafeAreaView?

ios - 在 iOS 应用程序中执行 bash 命令

ios - 混合方法 : Programmatically dismiss system dialogs like “<App> would like to access your contacts” in iOS

ios - 从另一个 ViewController 在 subview 上调用 AnimateWithDuration 时出错