Guy Carmeli пре 8 година
родитељ
комит
cd66729398
1 измењених фајлова са 11 додато и 0 уклоњено
  1. 11
    0
      example-redux/src/screens/SecondTabScreen.js

+ 11
- 0
example-redux/src/screens/SecondTabScreen.js Прегледај датотеку

45
             <Text style={styles.button}>Select First Tab</Text>
45
             <Text style={styles.button}>Select First Tab</Text>
46
           </TouchableOpacity>
46
           </TouchableOpacity>
47
 
47
 
48
+          <TouchableOpacity onPress={ this.onSetTabBadgePress.bind(this) }>
49
+            <Text style={styles.button}>Set Tab Badge</Text>
50
+          </TouchableOpacity>
51
+
48
           <Text style={{fontWeight: '500'}}>String prop: {this.props.str}</Text>
52
           <Text style={{fontWeight: '500'}}>String prop: {this.props.str}</Text>
49
           <Text style={{fontWeight: '500'}}>Number prop: {this.props.num}</Text>
53
           <Text style={{fontWeight: '500'}}>Number prop: {this.props.num}</Text>
50
           <Text style={{fontWeight: '500'}}>Object prop: {this.props.obj.str}</Text>
54
           <Text style={{fontWeight: '500'}}>Object prop: {this.props.obj.str}</Text>
143
       }
147
       }
144
     });
148
     });
145
   }
149
   }
150
+
151
+  onSetTabBadgePress() {
152
+    this.props.navigator.setTabBadge({
153
+      badge: this.props.counter.count,
154
+      tabIndex: 1
155
+    });
156
+  }
146
 }
157
 }
147
 
158
 
148
 const styles = StyleSheet.create({
159
 const styles = StyleSheet.create({