react-native-material-ui icon indicating copy to clipboard operation
react-native-material-ui copied to clipboard

Toolbar rightElement is shown on the left

Open ercpereda opened this issue 7 years ago • 5 comments

I'm trying to put a profile image on the right side of the toolbar. I use this code

<Toolbar rightElement={ <Avatar text="E" /> } />

but the Avatar element appear in the left side.

ercpereda avatar Jun 05 '17 21:06 ercpereda

I can replicate this. I thought that if you don't have a centerElement on the Toolbar was causing this but it happens regardless.

peterchibunna avatar Dec 28 '17 17:12 peterchibunna

@ercpereda depends on the flexGrow in the Avatar style

duplicate -> https://github.com/xotahal/react-native-material-ui/issues/264

aburai avatar Jan 16 '18 21:01 aburai

With the change we can use

rightElement={ <Avatar text="E" style={{ main: { flexGrow: 0 }}} /> }

to override the default, that i don't want to change.

aburai avatar Jan 16 '18 22:01 aburai

Interesting. Would it help if you wrap the Avatar with extra View? Have to check what happens in there ..

xotahal avatar Jan 22 '18 16:01 xotahal

HI, any alternative solution for this. I have used this package for my project and it is not working for ios.

Not working in ios

rightElement={{ menu: { icon: "more-vert", labels: ["Change Password", "Logout"] } }}


Not working for both ios and android.

rightElement='more-vert'

Screenshot_1553238468

sai905905 avatar Mar 22 '19 07:03 sai905905