I'm rendering a custom topBar title component with these options:
static get options() {
return {
topBar: {
drawBehind: false,
title: {
component: {
name: 'navigation.Logo',
alignment: 'center',
},
},
},
}
}
Which is correctly centering the custom component. However, when I push a view onto the stack and navigate back the custom component is no longer centered.
I can repro this in the playground app. Start playground app, tap Options on the bottom, tap Set React Title View, tap Push, tap Pop or Pop to Root. The custom component is no longer centered.
^ These are the versions I'm seeing this issue with. It's also happening with the playground versions.
Having the same issue. The following is not working either
Navigation.setDefaultOptions({
topBar: {
background: {
color: backgroundColor,
},
title: {
alignment: `center`
},
backButton: {
color: titleStyle.color,
},
},
})
Same thing for me.
Navigation.setDefaultOptions({
statusBar: {
visible: true,
style: 'light'
},
topBar: {
visible: true,
title: {
component: { name: LOGO_ICON },
alignment: 'center'
},
background: { color: '#1d1d1d' },
backButton: { visible: false, },
noBorder: true,
},
layout: {
orientation: ['portrait'],
},
});
I commented the following line
https://github.com/wix/react-native-navigation/blob/c6b6f731f4f0288da9c01dec3088dc4b903f8baf/lib/ios/RNNViewControllerPresenter.m#L183
And it fix the issue in my case
That also worked for me
IOS fix works for me as well.
Using
React Native: 0.58.4
ios 12.1 emulation
RN: ^0.58.4
RNN : ^2.11.0
also works for me
I hope they will get this into a update patch soon or something like it.
This fix works for me.
I am doing this temporarily in postInstall
. For anyone looking for a hack ;)
find . -name 'RNNViewControllerPresenter.m' -exec sed -i -e '/\[\_customTitleView setFrame\:frame];/s/^/\/\//g' {} \;
which will comment the line
Fix worked for me as well.
Looks like it was fixed with this commit: https://github.com/wix/react-native-navigation/commit/ac60d2fe6ad036528c31954a2997109b06f0c947#diff-8e71e0bc0406a74d2ee34eb8926fc021
So it should be ok with 2.17.0 can someone confirm?
I can't try right now
@yfuks It was fixed in 2.17.0
This fix should be added to Changelog as well
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.
The issue has been closed for inactivity.
Most helpful comment
I commented the following line
https://github.com/wix/react-native-navigation/blob/c6b6f731f4f0288da9c01dec3088dc4b903f8baf/lib/ios/RNNViewControllerPresenter.m#L183
And it fix the issue in my case