{"id":28997800,"url":"https://github.com/hqs5678/qtabs-swift","last_synced_at":"2025-06-25T06:30:30.935Z","repository":{"id":62451557,"uuid":"100904038","full_name":"hqs5678/qtabs-swift","owner":"hqs5678","description":"swift3.0   tabs","archived":false,"fork":false,"pushed_at":"2017-10-18T03:11:46.000Z","size":2082,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-25T01:49:38.502Z","etag":null,"topics":["qtabs","qtabview","swift","swift-tabs","tabs","tabview"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hqs5678.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-21T02:25:56.000Z","updated_at":"2017-08-24T13:03:46.000Z","dependencies_parsed_at":"2022-11-01T23:46:01.648Z","dependency_job_id":null,"html_url":"https://github.com/hqs5678/qtabs-swift","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hqs5678/qtabs-swift","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hqs5678%2Fqtabs-swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hqs5678%2Fqtabs-swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hqs5678%2Fqtabs-swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hqs5678%2Fqtabs-swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hqs5678","download_url":"https://codeload.github.com/hqs5678/qtabs-swift/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hqs5678%2Fqtabs-swift/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261818713,"owners_count":23214350,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["qtabs","qtabview","swift","swift-tabs","tabs","tabview"],"created_at":"2025-06-25T06:30:24.775Z","updated_at":"2025-06-25T06:30:30.898Z","avatar_url":"https://github.com/hqs5678.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# QTabView\n\n标签页，可以用于新闻的界面、有不同分类的界面等。已适配横屏。\n\nAndroid 版：https://github.com/hqs5678/hqs-common-tabs-android\n\n##### 运行效果图\n![运行效果图](https://github.com/hqs5678/qtabs-swift/blob/master/2017-08-24%2017_35_32.gif)\n\n### 实现原理\n封装QHorizontalTableView，添加界面切换的过度动画。\n\n\u003e QHorizontalTableView是封装的UICollectionView，实现简单的水平表格布局，可单独用于其他项目。例如：\n\u003e \n\u003e pod 'QHorizontalTableView'\n\u003e \n\u003e 项目地址：http://git.oschina.net/hqs.com/horizontaltableview-swift\n\n### 安装说明\n### CocoaPods\n```\nsource 'https://github.com/CocoaPods/Specs.git'\nplatform :ios, '8.0'\n\ntarget 'TargetName' do\n\npod 'QHorizontalTableView'\n\nend\n```\n\n \n#### 使用方法\n\n核心代码如下：\n\n```\n\ntabs = QTabView(frame: self.view.frame)\nself.view.addSubview(tabs)\n\nlet blue = UIColor(hexString: \"1c50f6\")\n// 设置指示器颜色\ntabs.indicatorColor = blue\n// 设置正常状态下标题的颜色\ntabs.titleNormalColor = UIColor.darkGray\n// 设置选中状态下标题的颜色\ntabs.titleSelectedColor = blue\n// 设置指示器的高度\ntabs.indicatorHeight = 2\n// 设置标题的背景颜色\ntabs.titleBackgroundColor = UIColor.lightGray.withAlphaComponent(0.3)\n\n// 自动布局，设置在父控件中的位置\ntabs.layoutInSuperview(20, 0, 0, 0)\n\n// 设置标题\ntabs.titles = [\"推荐\", \"娱乐明星\", \"体育\", \"新热点\", \"新闻\", \"帅哥\", \"美女\", \"娱乐明星\", \"体育\", \"新热点\", \"新闻\", \"帅哥\", \"美女\"]\n\n// 模拟每个标签页的内容\nfor i in 0 ..\u003c tabs.titles.count {\n    let vc = VC1()\n    vc.index = \"\\(tabs.titles[i]) \\(i)\"\n    \n    // 以 addChildViewController 的方式设置标签页内容\n    self.addChildViewController(vc)\n}\n\n```\n\n### 注意\ntabs.titles.count 要和 self.childViewControllers.count 一致！！！\n\n\n如有其他问题， 请下载运行项目，参考示例代码（Demo分支）。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhqs5678%2Fqtabs-swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhqs5678%2Fqtabs-swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhqs5678%2Fqtabs-swift/lists"}