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

Navbar with Image #223

Open
ehdwns980416 opened this issue Aug 14, 2020 · 1 comment
Open

Navbar with Image #223

ehdwns980416 opened this issue Aug 14, 2020 · 1 comment

Comments

@ehdwns980416
Copy link

I want to put my app logo in the <Navbar/> without the title.
I tried to put in left prop, but it's not work. How can I put image in the <Navbar/>?

This is the code I tried.

import { Image } from 'react-native';
import { NavBar } from 'galio-framework';
...
const leftComponent = () => {
    return (
        <Image
            resizeMode="contain"
            source={require("../../images/logo-navbar.png")}
        />
    );
}
...
<NavBar
    title=""
    style={styles.navbar}
    left={leftComponent}
    leftStyle={{
        width: 270,
        height: 80
    }}
/>
@ehdwns980416
Copy link
Author

I find the solution, and I want you to add function type on the left prop and right one.
Those are just node type, so I couldn't put function in them.

I can put <Image/> with below code, but I need function type to look my code better.

<NavBar
    flex
    title=""
    style={styles.navbar}
    left={
        <Image
            resizeMode="contain"
            source={require("../../images/logo-navbar.png")}
            style={{
                width: 270,
                height: 80,
            }}
        />
    }
/>

NavBar - Documentation @ galio
image

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

1 participant