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?
-
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.– oxigenJul 27, 2018 at 13:56
-
1when I say shadow I mean the line that separates the navigation bar from the rest of the screen– Daniel AmaranteJul 27, 2018 at 14:07
Add a comment
|
1 Answer
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];
}
}