question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RightBar BarButton ordering is opposite on iOS vs Android

See original GitHub issue

Hi,

When I create a RightBar with multiple BarButtons, the order is reversed on iOS compared to Android.

Screenshot 2020-08-26 at 12 49 38

This doesn’t appear to impact LeftBar

Screenshot 2020-08-26 at 12 50 48

Here’s some sample code from those two screenshots, from the zoom sample:

<NavigationBar
  title="Color"
  barTintColor={Platform.OS === 'android' ? '#fff' : null}>
  <TitleBar style={styles.titleBar}>
    <Text style={styles.titleBarText}>Color</Text>
    <View style={{backgroundColor: color, width: 28, height: 28}}/>
  </TitleBar>
  <LeftBar>
    <BarButton title="cancel 1" show="always" onPress={() => {
      stateNavigator.navigateBack(1);
    }} />
    <BarButton title="cancel 2" show="always" onPress={() => {
      stateNavigator.navigateBack(1);
    }} />
  </LeftBar>
  <RightBar>
    <BarButton title="cancel 1" show="always" onPress={() => {
      stateNavigator.navigateBack(1);
    }} />
    <BarButton title="cancel 2" show="always" onPress={() => {
      stateNavigator.navigateBack(1);
    }} />
  </RightBar>
</NavigationBar>

You can see this on my branch, here: https://github.com/salockhart/navigation/tree/bar-button-order

Any thoughts? It’s reasonably trivial for me to get around this, but it’s a bit annoying to remember to do.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
salockhartcommented, Aug 26, 2020

Yep that’s no issue at all. Thanks for your input!

0reactions
grahammendickcommented, Sep 28, 2020

Great, thanks! It’s all going into master

Read more comments on GitHub >

github_iconTop Results From Across the Web

UIBarButtonItems appear in the wrong order - Stack Overflow
I guess that's just because right bar buttons are added from right to left, so just change your array order to {b3,b2,b1}.
Read more >
Right Bar Button vs Bottom Button - iOS - UX Stack Exchange
Apple uses both right bar button and bottom button in different cases. It's obvious that reaching the bottom button is more comfortable than ......
Read more >
Customizing Your App's Navigation Bar - Apple Developer
Create custom titles, prompts, and buttons in your app's navigation bar. ... This sample shows how to set a segmented control as the...
Read more >
Android vs. iOS: Which is better for security? | Norton
iOS and Android operating systems and the devices that run them have become targets for malware and viruses. Which is more secure?
Read more >
Android vs iOS - Difference and Comparison - Diffen
Google's Android and Apple's iOS are operating systems used primarily in mobile ... on their phone, or even purchase phones with out-of-date software....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found