-3

enter image description here

I am thinking of implementing a UISegmentControl extension to achieve the twitter's iOS notification tab bar, navigation bar segment style. I tried extending the class like in this post.

I want to be able to control the size of the underline that scales based on the text's width, just like in the app.

Any ideas or suggestions are appreciated.

Vivek Pattanaik
  • 90
  • 1
  • 13
  • Try providing code for what you have done so that at least we know where to start when helping you – Denzel Mar 16 '22 at 02:35

3 Answers3

2

Yes

Have a top row section: Icon | Notifications | Settings Icon Then a bottom row: All | Mentions

You make a container for each section in the bottom row that takes 50% of the width of the row and then have a block inside each section for the text. The width of block should only be as wide as the text so that when you add a bottom border to it, it only spans as far as the text goes

Ruben Verster
  • 301
  • 1
  • 8
1

You can create your custom Top Bar.

  1. Add two views each containing your label with text, below that label add a view whose leading and trailing constraint from label. add both of these views in Stack View and fill equally. For tap you can use TapGesture or UIButton.
  2. Use collection view for dynamic tabs.
  3. UIPageViewController below for different screens.
  4. I have attached a screen i designed for reference
  5. enter image description here
Toqir Ahmad
  • 281
  • 3
  • 5
0

XLPagerTabStrip is a Container View Controller that allows us to switch easily among a collection of view controllers. Pan gestures can be used to move on to the next or previous view controller. It shows an interactive indicator of the current, previous, next child view controllers.

https://github.com/xmartlabs/XLPagerTabStrip

Raza Baloch
  • 334
  • 4
  • 9