所以首先我有一个新闻应用程序,所以它有不同的类别,如业务,国家,国家新闻等,所以我需要一个滚动条,像下图所示的按钮。
我不知道它叫做tabbar,带按钮的酒吧还有别的故事板。
我搜索了每一个谷歌,但无法找到它,因为我不知道它叫什么
直到现在我已经尝试创建一个垂直滚动视图并添加按钮,但如果不满足我的要求,我想要更好的东西..如果您发现任何GitHub项目,它将会很好。
我甚至尝试了分段控制,但它没有保存更多的类别,它变得越来越小,所以我想要像顶部图像中显示的东西。
更新
点击任何按钮我想刷新类别的内容的表视图...
标签栏不会工作
提前谢谢你的帮助
So first thing i have a news app so it has different category like business,national,state news and etc so i need a scrolling bar with button like this shown in the below image.
i don't know what it is called tabbar, bar with buttons or there is something else storyboard.
i have searched every where one google but could not found it because i don't know what it is called
Till now i have try creating a vertical scrollview and adding buttons to it but if is not upto my staisfaction i want something better.. if you find any GitHub projects it will be good.
i even tried segmented control but it doesn't hold more category it becomes smaller and smaller so i want something like shown in the top image.
UPDATED
On click of any button i want to refresh the table view with the content of of category ...
Tab bar wont work
Thank You for your help in advance
最满意答案
你的答案已经在Adrian B的评论中给出。
我不知道你是怎么做的。 首先它被称为Tab Swipe导航
使用碳套件
https://github.com/melieskubrick/CarbonKitSwift
所以首先将元素添加到您的视图。 这就是您使用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() }你想刷新你的消息,使用CarbonTabSwipeNavigationDelegate的Carbon Kit委托方法,你可以刷新你的tableview。
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 } }信用
阿德里安B CarbonKitSwiftYour answer was already given in the comment by Adrian B..
i ill explain you how you have to do it. first of all it is called Tab Swipe navigation
Make use of Carbon kit
https://github.com/melieskubrick/CarbonKitSwift
So first add the elements to your view. this is the way how you add using 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() }You want to refresh your news so using delegate method of Carbon Kit which is CarbonTabSwipeNavigationDelegate you can refresh your tableview.
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 } }Credit
Adrian B CarbonKitSwift更多推荐
发布评论