1

In the app store, currently, when you are scrolled all the way to the top it shows the large title and the shadow (line that separates nav bar from content) doesn't go all the way to the sides, leaving a small gap. But when you start scrolling, the shadow changes and goes all the way to the sides of the device. Is there a proper way to do that?

enter image description here

enter image description here

2
  • I don't see shadows in your screens. As I can see, When you open appstore, navBar has empty title. And when you start scroll, they just add title @"Apps" to navBar. "Large title with avatar" is just first cell in the tableView.
    – oxigen
    Jul 27, 2018 at 13:56
  • 1
    when I say shadow I mean the line that separates the navigation bar from the rest of the screen Jul 27, 2018 at 14:07

1 Answer 1

1
self.tableView.delegate = self;
....
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
    if (scrollView.contentOffset.y > 95) {
        self.title = @"TITLE";
    } else {
        self.title = @"";
    }

    if (scrollView.contentOffset.y > 100) {
        self.navigationController.navigationBar.shadowImage = nil;
    } else {
        self.navigationController.navigationBar.shadowImage = [UIImage new];

    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.