@@ -47,13 +47,11 @@ var FacebookTabBar = React.createClass({
4747 console . log ( name ) ;
4848
4949 return (
50- < TouchableOpacity key = { name } onPress = { ( ) => this . props . goToPage ( page ) } >
51- < View style = { [ styles . tab ] } >
52- < Icon name = { name } size = { 30 } color = '#3B5998' style = { { width : 30 , height : 30 , position : 'absolute' , top : 0 , left : 20 } }
53- ref = { ( icon ) => { this . selectedTabIcons [ page ] = icon } } />
54- < Icon name = { name } size = { 30 } color = '#ccc' style = { { width : 30 , height : 30 , position : 'absolute' , top : 0 , left : 20 } }
55- ref = { ( icon ) => { this . unselectedTabIcons [ page ] = icon } } />
56- </ View >
50+ < TouchableOpacity key = { name } onPress = { ( ) => this . props . goToPage ( page ) } style = { [ styles . tab ] } >
51+ < Icon name = { name } size = { 30 } color = '#3B5998' style = { { width : 30 , height : 30 , position : 'absolute' , top : 0 , left : 20 } }
52+ ref = { ( icon ) => { this . selectedTabIcons [ page ] = icon } } />
53+ < Icon name = { name } size = { 30 } color = '#ccc' style = { { width : 30 , height : 30 , position : 'absolute' , top : 0 , left : 20 } }
54+ ref = { ( icon ) => { this . unselectedTabIcons [ page ] = icon } } />
5755 </ TouchableOpacity >
5856 ) ;
5957 } ,
@@ -62,11 +60,16 @@ var FacebookTabBar = React.createClass({
6260 var currentPage = this . props . activeTab ;
6361
6462 this . unselectedTabIcons . forEach ( ( icon , i ) => {
63+ var iconRef = icon ;
64+
65+ if ( ! icon . setNativeProps && icon !== null ) {
66+ iconRef = icon . refs . icon_image
67+ }
6568 if ( value - i >= 0 && value - i <= 1 ) {
66- icon . setNativeProps ( { opacity : value - i } ) ;
69+ iconRef . setNativeProps ( { opacity : value - i } ) ;
6770 }
6871 if ( i - value >= 0 && i - value <= 1 ) {
69- icon . setNativeProps ( { opacity : i - value } ) ;
72+ iconRef . setNativeProps ( { opacity : i - value } ) ;
7073 }
7174 } ) ;
7275 } ,
0 commit comments