|
@@ -45,6 +45,10 @@ class SecondTabScreen extends Component {
|
45
|
45
|
<Text style={styles.button}>Select First Tab</Text>
|
46
|
46
|
</TouchableOpacity>
|
47
|
47
|
|
|
48
|
+ <TouchableOpacity onPress={ this.onSetTabBadgePress.bind(this) }>
|
|
49
|
+ <Text style={styles.button}>Set Tab Badge</Text>
|
|
50
|
+ </TouchableOpacity>
|
|
51
|
+
|
48
|
52
|
<Text style={{fontWeight: '500'}}>String prop: {this.props.str}</Text>
|
49
|
53
|
<Text style={{fontWeight: '500'}}>Number prop: {this.props.num}</Text>
|
50
|
54
|
<Text style={{fontWeight: '500'}}>Object prop: {this.props.obj.str}</Text>
|
|
@@ -143,6 +147,13 @@ class SecondTabScreen extends Component {
|
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
|
159
|
const styles = StyleSheet.create({
|