Artal Druk преди 8 години
родител
ревизия
640773c374
променени са 4 файла, в които са добавени 30 реда и са изтрити 0 реда
  1. 5
    0
      .gitignore
  2. 11
    0
      example/src/screens/ThirdTabScreen.js
  3. 4
    0
      src/Screen.js
  4. 10
    0
      src/platformSpecific.ios.js

+ 5
- 0
.gitignore Целия файл

@@ -136,6 +136,11 @@ xcuserdata
136 136
 *.gcda
137 137
 *.gcno
138 138
 
139
+####
140
+# Webstrom
141
+
142
+.idea
143
+
139 144
 ####
140 145
 # UNKNOWN: recommended by others, but I can't discover what these files are
141 146
 #

+ 11
- 0
example/src/screens/ThirdTabScreen.js Целия файл

@@ -26,6 +26,10 @@ export default class ThirdTabScreen extends Component {
26 26
           <Text style={styles.button}>Push Styled Screen</Text>
27 27
         </TouchableOpacity>
28 28
 
29
+        <TouchableOpacity onPress={ this.onPushStyled2Press.bind(this) }>
30
+          <Text style={styles.button}>Push Styled Screen 2</Text>
31
+        </TouchableOpacity>
32
+
29 33
         <TouchableOpacity onPress={ this.onModalPress.bind(this) }>
30 34
           <Text style={styles.button}>Show Modal Screen</Text>
31 35
         </TouchableOpacity>
@@ -45,6 +49,13 @@ export default class ThirdTabScreen extends Component {
45 49
       screen: "example.StyledScreen"
46 50
     });
47 51
   }
52
+  onPushStyled2Press () {
53
+    this.props.navigator.push({
54
+      title: "Styled",
55
+      titleImage: require('../../img/two.png'),
56
+      screen: "example.StyledScreen"
57
+    });
58
+  }
48 59
   onModalPress() {
49 60
     this.props.navigator.showModal({
50 61
       title: "Modal",

+ 4
- 0
src/Screen.js Целия файл

@@ -61,6 +61,10 @@ class Navigator {
61 61
     return platformSpecific.navigatorSetTitle(this, params);
62 62
   }
63 63
 
64
+  setTitleImage(params = {}) {
65
+    return platformSpecific.navigatorSetTitleImage(this, params);
66
+  }
67
+
64 68
   toggleDrawer(params = {}) {
65 69
     return platformSpecific.navigatorToggleDrawer(this, params);
66 70
   }

+ 10
- 0
src/platformSpecific.ios.js Целия файл

@@ -183,6 +183,7 @@ function navigatorPush(navigator, params) {
183 183
   passProps.navigatorEventID = navigatorEventID;
184 184
   Controllers.NavigationControllerIOS(navigator.navigatorID).push({
185 185
     title: params.title,
186
+    titleImage: params.titleImage,
186 187
     component: params.screen,
187 188
     animated: params.animated,
188 189
     passProps: passProps,
@@ -223,6 +224,7 @@ function navigatorResetTo(navigator, params) {
223 224
   passProps.navigatorEventID = navigatorEventID;
224 225
   Controllers.NavigationControllerIOS(navigator.navigatorID).resetTo({
225 226
     title: params.title,
227
+    titleImage: params.titleImage,
226 228
     component: params.screen,
227 229
     animated: params.animated,
228 230
     passProps: passProps,
@@ -238,6 +240,13 @@ function navigatorSetTitle(navigator, params) {
238 240
   });
239 241
 }
240 242
 
243
+function navigatorSetTitleImage
244
+(navigator, params) {
245
+  Controllers.NavigationControllerIOS(navigator.navigatorID).setTitleImage({
246
+    titleImage: params.titleImage
247
+  });
248
+}
249
+
241 250
 function navigatorToggleDrawer(navigator, params) {
242 251
   const controllerID = navigator.navigatorID.split('_')[0];
243 252
   if (params.to == 'open') {
@@ -399,6 +408,7 @@ export default {
399 408
   dismissLightBox,
400 409
   navigatorSetButtons,
401 410
   navigatorSetTitle,
411
+  navigatorSetTitleImage,
402 412
   navigatorToggleDrawer,
403 413
   navigatorToggleTabs,
404 414
   navigatorSetTabBadge,