React-native-paper: Appbar.Header with ImageBackground support

Created on 9 May 2019  路  4Comments  路  Source: callstack/react-native-paper

Most helpful comment

Exactly, you can wrap your AppHeader within ImageBackground from react-native. Here you can check my example

All 4 comments

Can you add a description, please?

Hey @Taym95 - I'd like to expand on this actually. I think a broader solution would be to allow for a renderBackground that accepts an arbitrary component for the background. For example, @lpasquini wants the Appbar.Header to have an image background, but in my case I'd like to pass in a LinearGradient component so that the background isn't a solid color (but instead a gradient). Currently, this isn't possible.

EDIT: After looking at the source, I realized (at least in my case) I could set the background color as transparent for and wrap it in a LinearGradient component. Works fine!

After looking at the source, I realized (at least in my case) I could set the background color as transparent for and wrap it in a LinearGradient component. Works fine!

So with ImageBackground we can solve the problem of @lpasquini, right?
Maybe we need an option with wrapper component like <Appbar.Header wrapComponent={} ... />

Exactly, you can wrap your AppHeader within ImageBackground from react-native. Here you can check my example

Was this page helpful?
0 / 5 - 0 ratings

Related issues

makhataibar picture makhataibar  路  4Comments

yaronlevi picture yaronlevi  路  3Comments

ZhengYuTay picture ZhengYuTay  路  3Comments

zachariahtimothy picture zachariahtimothy  路  3Comments

zxccvvv picture zxccvvv  路  4Comments