Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
661 views
in Technique[技术] by (71.8m points)

ios - show all tabs with scrolling option (on screen there should be only 4 tabs)

I am newbie for iOS development. What I have done so far is as below.

  1. Created New Project
  2. Removed all controller and added View Controller.
  3. Dragged ScrollView in ViewController
  4. Dragged Tab Bar in ScrollView
  5. Dragged 7 Tab Bar Item in Tab Bar.

Now when I execute this project, I have all 7 tabs on screen which is not looking good. So what I am planning is display only 4 tab at first and if user scroll it horizontally, user can scroll and see rest tabs.

So, what I want to achieve is programmatically set some parameter in ScrollView that it will display only first 4 options only.

Any idea/ suggestion on this to be done?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

EDIT :

I think this one may be even more adapted to the situation. Contrary to KLHorizontalSelect, it's kind of old (no commit on the master branch for a year ?) and I have no experience with it, but it may solve your problem : InfiniTabBar.

The description is short :

A scrolling tab bar with space for infinite items


Maybe you can take a look at this control : KLHorizontalSelect.

Here's how it looks like :

enter image description here

I don't think it looks exactly as you want, but I think it works almost as what you're expecting. Maybe you can work on the design ?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...