I create an application and in one of the types of navigation, I have a very similar design, such as the App Store application - see details | Reviews | Linked section. Following similar lines, I want to implement segmented control in the same way that Apple did in my application. (This is also similar to what Apple does in Artist → Albums view mode in the iOS 7 music app by default, albeit for the table title (maybe).)
- If you scroll up when the segmented control container touches the navigation bar, it stays there.
- It also allows the user to notice that this is a kind of overlay due to the alpha associated with it.
- When you scroll down, it moves to the right place if necessary.
What I've done -
I created a container view with a segmented control. When the scrollView scrolls, I rearrange the container view to perform a sticky effect. This is just pseudo code, but my code really works.
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
if (scrollView == self.labTestScrollView)
{
}
}
There are two problems:
- No overlay effect. I can tweak the alpha to make the effect a little more noticeable, but that doesn't seem natural.
- The second problem is related to the first. This seems like a very specific solution. I look forward to what is more natural; and something that might work by default using table views or something like that.
source
share