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.

[Android] Header does not have left and right padding on Android

See original GitHub issue

Hi.

I’m using @react-navigation/native-stack in my app, and I have an issue with Header on Android. When the header doesn’t show back button, the title is stuck to the left side of the screen without any padding.

The header right can be solved with CSS, but I couldn’t find a way to do the same with title on Android.

2020-02-15 17 25 57

Thank you

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
taismassarocommented, Mar 5, 2020

hi @kmagiera I’ve read the release commit list for version 2.2.0 and it says this fix should already be there, but that’s the version I’m using and I’m still having this inconsistency between Android and iOS.

I’m using react-native-screens/native-stack for the Stack and @react-navigation/native hooks to show the header on screens I want skip or back buttons:

if (backButton || skipAction) {
      navigation.setOptions({
        title: '',
        headerShown: true,
        headerHideBackButton: !backButton,
        headerHideShadow: true,
        headerBackTitleVisible: false,
        headerRight: showSkipButton,
        contentStyle: [t.bgWhite],
        headerStyle: { backgroundColor: t.textWhite.color },
        headerTintColor: t.textBlack.color,
      });
    }
<kbd> </kbd>
<kbd> </kbd>

  maybe my approach isn’t correct? can you give me some insight on this? 😬

thanks!

1reaction
kddccommented, Feb 18, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

Listview : different padding for header & content - Stack Overflow
My trouble is that the header needs to have no padding whereas the existing lists already have a 20dp padding. It could setup...
Read more >
FrameLayout - Android Developers
The size of the FrameLayout is the size of its largest child (plus padding), visible or not (if the FrameLayout's parent permits). Views...
Read more >
overflow-x - CSS: Cascading Style Sheets - MDN Web Docs
The overflow-x CSS property sets what shows when content overflows a block-level element's left and right edges. This may be nothing, ...
Read more >
Supporting safe areas | React Navigation
Navigation bar on Android. The area not overlapped by such items is referred to as "safe area". We try to apply proper insets...
Read more >
padding | CSS-Tricks
If three values are declared, it is padding: [top] [left-and-right] [bottom]; . Any of the individual padding properties can be declared using ...
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