gpt4 book ai didi

ios - 我如何获得带按钮的滚动条?

转载 作者:搜寻专家 更新时间:2023-10-31 21:53:25 25 4
gpt4 key购买 nike

所以首先我有一个新闻应用程序,所以它有不同的类别,如商业、国家、州新闻等,所以我需要一个带有按钮的滚动条,如下图所示。

Bar with Buttons

我不知道它叫什么标签栏,带按钮的栏或其他 Storyboard。

我用谷歌搜索了所有地方但找不到它,因为我不知道它叫什么

到目前为止,我已经尝试创建一个垂直 ScrollView 并向其添加按钮,但如果不符合我的能力,我想要更好的东西..如果你找到任何 GitHub 项目,那会很好。

我什至尝试过分段控制,但它并没有容纳更多的类别,它变得越来越小,所以我想要像上图所示的东西。

UPDATED

点击任何按钮我想用类别的内容刷新表格 View ...

标签栏不起作用

提前感谢您的帮助

最佳答案

你的答案已经在 Adrian B.. 的评论中给出了。

我将向您解释如何做到这一点。首先它被称为Tab Swipe导航

利用碳套件

https://github.com/melieskubrick/CarbonKitSwift

所以首先将元素添加到您的 View 中。这是使用 Carbon Kit

添加的方式
override func viewDidLoad() {
super.viewDidLoad()

self.title = "CarbonKit"
items = [UIImage(named: "home")!, UIImage(named: "hourglass")!, UIImage(named: "premium_badge")!, "Categories", "Top Free", "Top New Free", "Top Paid", "Top New Paid"]
carbonTabSwipeNavigation = CarbonTabSwipeNavigation(items: items as [AnyObject], delegate: self)
carbonTabSwipeNavigation.insertIntoRootViewController(self)
self.style()

}

你想刷新你的新闻,所以使用 Carbon Kit 的委托(delegate)方法 CarbonTabSwipeNavigationDelegate 你可以刷新你的表格 View 。

 func carbonTabSwipeNavigation(carbonTabSwipeNavigation: CarbonTabSwipeNavigation, viewControllerAtIndex index: UInt) -> UIViewController {

switch index {
case 0:
//Do your table view refresh here Business category
case 1:
//Do your table view refresh here other category

default:
//Do your table view refresh here all category which will be default

}

}

信用

关于ios - 我如何获得带按钮的滚动条?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34455407/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com