Skip to content

Commit 5642161

Browse files
committed
update
1 parent 450d45f commit 5642161

File tree

3 files changed

+63
-1
lines changed

3 files changed

+63
-1
lines changed

Test/App.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ import {
1111

1212
import React from 'react';
1313

14+
import CardStackStyleInterpolator from 'react-navigation/src/views/CardStackStyleInterpolator';
15+
16+
1417
import {
1518
Image,
1619
StyleSheet,
@@ -34,6 +37,8 @@ const MainIcon = require('../resources/Main.png');
3437
* 3、Test3是通过封装navigationOptions实现Tabbar和导航的
3538
*/
3639

40+
41+
3742
const MyTab = TabNavigator({
3843
Test1: {
3944
screen: Test1,
@@ -122,6 +127,8 @@ const MyTab = TabNavigator({
122127

123128
});
124129

130+
131+
125132
// 初始化StackNavigator
126133
const MyNav = StackNavigator({
127134
// 将TabNavigator包裹在StackNavigator里面可以保证跳转页面的时候隐藏tabbar
@@ -134,7 +141,10 @@ const MyNav = StackNavigator({
134141
},
135142
Detail2:{
136143
screen:Detail2,
137-
}
144+
},
145+
146+
},{
147+
138148
});
139149

140150
const TabOptions = (tabBarTitle,normalImage,selectedImage,navTitle) => {

Test/Detail3.js

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/**
2+
* Created by Rabbit on 2017/7/12.
3+
*/
4+
5+
import React, { Component } from 'react';
6+
import {
7+
AppRegistry,
8+
StyleSheet,
9+
Text,
10+
View
11+
} from 'react-native';
12+
13+
export default class Detail3 extends Component {
14+
render() {
15+
return (
16+
<View style={styles.container}>
17+
<Text style={styles.welcome}>
18+
Welcome to React Native!
19+
</Text>
20+
<Text style={styles.instructions}>
21+
To get started, edit index.android.js
22+
</Text>
23+
<Text style={styles.instructions}>
24+
Double tap R on your keyboard to reload,{'\n'}
25+
Shake or press menu button for dev menu
26+
</Text>
27+
</View>
28+
);
29+
}
30+
}
31+
32+
const styles = StyleSheet.create({
33+
container: {
34+
flex: 1,
35+
justifyContent: 'center',
36+
alignItems: 'center',
37+
backgroundColor: '#F5FCFF',
38+
},
39+
welcome: {
40+
fontSize: 20,
41+
textAlign: 'center',
42+
margin: 10,
43+
},
44+
instructions: {
45+
textAlign: 'center',
46+
color: '#333333',
47+
marginBottom: 5,
48+
},
49+
});

Test/Test2.js

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ export default class Test2 extends Component {
2323
headerTitle:navigation.state.params?navigation.state.params.headerTitle:'Test2',
2424
tabBarLabel:navigation.state.params?navigation.state.params.tabBarLabel:'Test2',
2525
tabBarIcon: (({tintColor,focused}) => {
26+
if(focused){
27+
// 做操作
28+
}
2629
return(
2730
<Image
2831
// 可以用过判断focused来修改选中图片和默认图片

0 commit comments

Comments
 (0)