Browse Source

Fixes broken bottomTab text and icon on initialization - #4039

yogevbd 6 years ago
parent
commit
b08e6565e6

+ 1
- 0
lib/ios/RNNRootViewController.m View File

@@ -79,6 +79,7 @@
79 79
 }
80 80
 
81 81
 - (void)willMoveToParentViewController:(UIViewController *)parent {
82
+	[_presenter presentOn:self];
82 83
 	if ([self.parentViewController respondsToSelector:@selector(performOnChildLoad:)]) {
83 84
 		[self.parentViewController performSelector:@selector(performOnChildLoad:) withObject:_presenter.options];
84 85
 	}

+ 4
- 0
lib/ios/RNNTabBarPresenter.m View File

@@ -6,4 +6,8 @@
6 6
 	[self.options applyOnTabBarController:tabBarController];
7 7
 }
8 8
 
9
+- (void)present:(RNNNavigationOptions *)options on:(UITabBarController *)tabBarController {
10
+	[self.options applyOnTabBarController:tabBarController];
11
+}
12
+
9 13
 @end

+ 19
- 0
playground/src/screens/WelcomeScreen.js View File

@@ -120,6 +120,25 @@ class WelcomeScreen extends Component {
120 120
                   }
121 121
                 }
122 122
               }
123
+            },
124
+            {
125
+              component: {
126
+                name: 'navigation.playground.TextScreen',
127
+                passProps: {
128
+                  text: 'This is tab 3',
129
+                  myFunction: () => 'Hello from a function!'
130
+                },
131
+                options: {
132
+                  topBar: {
133
+                    visible: true
134
+                  },
135
+                  bottomTab: {
136
+                    text: 'Tab 3',
137
+                    icon: require('../images/one.png'),
138
+                    selectedIcon: require('../images/one.png')
139
+                  }
140
+                }
141
+              }
123 142
             }
124 143
           ],
125 144
           options: {