Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to give new title image in parameter when navigating new scene #2363

Closed
althurzard opened this issue Sep 10, 2017 · 3 comments
Closed

How to give new title image in parameter when navigating new scene #2363

althurzard opened this issue Sep 10, 2017 · 3 comments

Comments

@althurzard
Copy link

althurzard commented Sep 10, 2017

Version

  • react-native-router-flux v4.0.0
  • react-native v0.47.2

I tried to navigate to new scene with these parameters

let imageStyle = {resizeMode:'contain',width:30,height:30,backgroundColor:'red'}
let imageUri = {uri:this.props.userInfo.profileUrl}
Actions.chat({navigationBarTitleImage: imageUri, navigationBarTitleImageStyle: imageStyle)

But it didnt work.

@althurzard althurzard changed the title How to give new scene title image in parameter How to give new title image in parameter when navigating new scene Sep 10, 2017
@mcabs3
Copy link
Collaborator

mcabs3 commented Sep 11, 2017

@althurzard for your navigationBarTitleImage are you passing an object? or an <Image /> component? navigationBarTitleImage requires you pass an Image RN component.

Let me know if that changes your outcome.

@althurzard
Copy link
Author

althurzard commented Sep 11, 2017

I tried sir but it didnt work either! @mcabs3

onPress = (userInfo) => {
 var avatar = (
   <Image
     style = {{width:30,height:30,backgroundColor:'black'}}
     source = {{uri:userInfo.profileUrl}}
     resizeMode = 'contain'
   />
 )
  Actions.chat({userInfo:userInfo,localUser:this.props.localUser, navigationBarTitleImage: avatar})
}

I took a look in navigationStore.js and saw that it only receives an object, doesnt it?

if (navigationBarTitleImage) {
      res.headerTitle = <Image source={navigationBarTitleImage} style={navigationBarTitleImageStyle} />;
 }

@mcabs3
Copy link
Collaborator

mcabs3 commented Sep 11, 2017

@althurzard touche! I will take a look

@onrige onrige closed this as completed Oct 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants