显示所有带有滚动选项的标签(在屏幕上应该只有4个标签) [英] show all tabs with scrolling option (on screen there should be only 4 tabs)

查看:123
本文介绍了显示所有带有滚动选项的标签(在屏幕上应该只有4个标签)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是iOS开发的新手.到目前为止,我所做的如下.

  1. 创建新项目
  2. 删除了所有控制器,并添加了View Controller.
  3. ViewController
  4. 中拖曳了ScrollView
  5. ScrollView
  6. 中拖曳的Tab Bar
  7. Tab Bar中拖曳了7个Tab Bar Item.

现在,当我执行该项目时,我在屏幕上的所有7个选项卡看起来都不太好.因此,我计划的是首先仅显示4个选项卡,如果用户水平滚动它,则用户可以滚动并查看其余选项卡.

因此,我要实现的是在ScrollView中以编程方式设置一些参数,使其仅仅显示前4个选项.

对此有什么想法/建议吗?

解决方案

我认为这可能更适合这种情况.与KLHorizo​​ntalSelect相反,它有点陈旧(一年没有在master分支上提交?),我没有经验,但是它可以解决您的问题: KLHorizo​​ntalSelect . /p>

这是它的样子:

我认为它外观不完全符合您的要求,但我认为它有效几乎符合您的期望.也许您可以进行设计?

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?

解决方案

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 :

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 ?

这篇关于显示所有带有滚动选项的标签(在屏幕上应该只有4个标签)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆