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.

[IOS] large title starts off hidden or in normal title state ?

See original GitHub issue

as if there is some contentOffset applied.

Nov-29-2020 19-18-01

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
grahammendickcommented, Nov 29, 2020

This only happens in iOS 14. The large title starts off expanded in iOS <= 13.

I know how to fix it but it involves a change RCTScrollContentView class in React Native. Open your project in XCode and paste this code into RCTScrollContentView

@implementation RCTScrollContentView

- (void)didMoveToWindow
{
    [super didMoveToWindow];
    RCTScrollView *scrollView = (RCTScrollView *)self.superview.superview;
    [scrollView updateContentOffsetIfNeeded];
}

- (void)reactSetFrame:(CGRect)frame
{
  [super reactSetFrame:frame];

  RCTScrollView *scrollView = (RCTScrollView *)self.superview.superview;

  if (!scrollView || !self.window) {
    return;
  }

  RCTAssert([scrollView isKindOfClass:[RCTScrollView class]], @"Unexpected view hierarchy of RCTScrollView component.");

  [scrollView updateContentOffsetIfNeeded];
}

@end

React Native Screens has the same issue and I provided them with this same fix. You can see from the issue comments that it has worked for everybody that has tried it.

I don’t plan on submitting a PR to React Native because they won’t look at it. I find the process too frustrating to engage with. But if you want to submit a PR to React Native on behalf of the Navigation router then that would be great.

If the fix works for you then you could use patch-package to apply it?

1reaction
grahammendickcommented, Nov 30, 2020

The FlatList counts as an outer ScrollView (an outer UIScrollView)

Read more comments on GitHub >

github_iconTop Results From Across the Web

ios - Hide large title when scrolling up - Stack Overflow
I found a workaround on this site basically, if the tableView (or element that has scroll)is not the first view in your view...
Read more >
Large title navigation bar tint color - Apple Developer
It is just displaying a white navigation bar. In dark mode, the bar is black when large, but goes to my custom color...
Read more >
The Large Title UINavigationBar Glitches and How to Fix Them
Check out this article to find out the glitches you might get when adopting the large title UINavigationBar, and how to fix each...
Read more >
Large Titles For Navigation Bars In iOS 11 - Chariot Solutions
Chariot's Steve Beyers demonstrates how to implement the iOS 11 style navigation with large titles both via the navigation bar instance and ...
Read more >
Fix large navigation bar title not hiding on scroll in iOS 11
There exist two bugs which can prevent the title from showing up. If you set prefers large title on the navigation bar in...
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