Skip to content
This repository has been archived by the owner on Nov 29, 2022. It is now read-only.

Glue the SegmentedControl below the navigation bar ? #64

Open
wongzigii opened this issue Nov 24, 2015 · 4 comments
Open

Glue the SegmentedControl below the navigation bar ? #64

wongzigii opened this issue Nov 24, 2015 · 4 comments

Comments

@wongzigii
Copy link

Great repo 👍
I just wondering is there an easy way to glue the segmentControl below navigation bar while scrolling?
It will be great if there is an API to accomplish this.

@dzenbot
Copy link
Owner

dzenbot commented Nov 25, 2015

Depends of your layout.
If you're using UITableView or UICollectionView you can add the segmentedControl as a floating section header view and give the impression it's stick to the navigation bar.

Another approach, would be to create a custom UINavigationBar subclass and do the hard work of actually extending the view to host the segmentedControl.

@dzenbot
Copy link
Owner

dzenbot commented Nov 25, 2015

This was an interesting challenge, so I took a few minutes to give it a try and it looks great.
Have a look in this branch: https://github.com/dzenbot/DZNSegmentedControl/tree/navigation-bar-experiment

The only remaining bug is that the segmented control isn't reacting to touch events, for some reason.

image

@wongzigii
Copy link
Author

Sounds wonderful. The first approach is a more easy way to achieve this.

@pomarec
Copy link

pomarec commented Jun 13, 2016

You can also have a look at https://github.com/bryankeller/BLKFlexibleHeightBar

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants