You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{Navigation}from'react-native-navigation';import{registerScreens}from'./screens';registerScreens();// this is where you register all of your app's screens// start the appNavigation.startTabBasedApp({tabs: [{label: 'One',screen: 'testingApp.FirstTabScreen',// this is a registered name for a screenicon: require('./img/one.png'),selectedIcon: require('./img/one_selected.png'),// iOS onlytitle: 'Screen One'},{label: 'Two',screen: 'testingApp.SecondTabScreen',icon: require('./img/two.png'),selectedIcon: require('./img/two_selected.png'),// iOS onlytitle: 'Screen Two'}],animationType: 'fade'});
Create screens FirstTabScreen.jsSecondTabScreen.js in screens
Then create index.js in same directory
import{Navigation}from'react-native-navigation';import{registerScreens}from'./screens';registerScreens();// this is where you register all of your app's screens// start the appNavigation.startTabBasedApp({tabs: [{label: 'One',screen: 'testingApp.FirstTabScreen',// this is a registered name for a screenicon: require('./img/one.png'),selectedIcon: require('./img/one_selected.png'),// iOS onlytitle: 'Screen One'},{label: 'Two',screen: 'testingApp.SecondTabScreen',icon: require('./img/two.png'),selectedIcon: require('./img/two_selected.png'),// iOS onlytitle: 'Screen Two'}],animationType: 'fade'});
Additional, how to get a splash screen
Modify MainActivity.java
packagecom.testingapp;
importandroid.widget.LinearLayout;
importandroid.graphics.Color;
importandroid.widget.TextView;
importandroid.view.Gravity;
importandroid.util.TypedValue;
importcom.reactnativenavigation.controllers.SplashActivity;
publicclassMainActivityextendsSplashActivity {
/** * Returns the name of the main component registered from JavaScript. * This is used to schedule rendering of the component. */@OverridepublicLinearLayoutcreateSplashLayout() {
LinearLayoutview = newLinearLayout(this);
TextViewtextView = newTextView(this);
view.setBackgroundColor(Color.parseColor("#ffffff"));
view.setGravity(Gravity.CENTER);
textView.setTextColor(Color.parseColor("#000000"));
textView.setText("Testing App");
textView.setGravity(Gravity.CENTER);
textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 40);
view.addView(textView);
returnview;
}
}