{"id":18695557,"url":"https://github.com/targetcloud/tgpageview","last_synced_at":"2025-07-12T00:05:47.666Z","repository":{"id":217810519,"uuid":"85969907","full_name":"targetcloud/TGPageView","owner":"targetcloud","description":"类似网易新闻的导航条，支持滚动、缩放动画、渐变、遮罩等，可以任意组合各效果，史上最赞","archived":false,"fork":false,"pushed_at":"2018-01-15T12:32:31.000Z","size":27,"stargazers_count":17,"open_issues_count":0,"forks_count":3,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-12T07:29:40.352Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/targetcloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-03-23T16:05:03.000Z","updated_at":"2023-10-26T06:11:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"b7083455-9090-4322-879a-07404ceea2a4","html_url":"https://github.com/targetcloud/TGPageView","commit_stats":null,"previous_names":["targetcloud/tgpageview"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/targetcloud/TGPageView","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/targetcloud%2FTGPageView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/targetcloud%2FTGPageView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/targetcloud%2FTGPageView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/targetcloud%2FTGPageView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/targetcloud","download_url":"https://codeload.github.com/targetcloud/TGPageView/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/targetcloud%2FTGPageView/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264915991,"owners_count":23682957,"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":[],"created_at":"2024-11-07T11:15:27.067Z","updated_at":"2025-07-12T00:05:47.654Z","avatar_url":"https://github.com/targetcloud.png","language":"Swift","readme":"# TGPageView\n类似网易新闻的导航条，支持滚动、缩放动画、渐变、遮罩等，可以任意组合各效果，史上最赞\n--------------------------------------------------------------------\n## 如何使用\n\n###### let pageViewFrame = CGRect(x: 0, y: 64, width: view.bounds.width, height: view.bounds.height - 64 )//非scrollView设置64\n\n#### 1 默认不可滚动，底下有跟踪滚动条（下划线） 等分\n\u003e ######  let titles = [\"推荐\",\"视频\",\"图片\",\"段子\",\"投票\"]\n\u003e ######  let style = TGPageStyle()\n\n#### 2 滚动模式，底下有跟踪滚动条（下划线） 不等分，根据文字大小设置下划线\n\u003e ######  let titles = [\"推荐\",\"视频\",\"这是一个测试\",\"图片\",\"段子\",\"投票\",\"排行\",\"互动区\",\"网红\",\"社会\",\"美女\",\"冷知识\",\"游戏\"]\n\u003e ######  let style = TGPageStyle()\n\u003e ######  style.isScrollEnable = true//滚动模式\n\n        \n#### 3 无跟踪滚动条（下划线）  用遮罩  缩放支持\n\u003e ######  let titles = [\"推荐\",\"视频\",\"这是一个测试\",\"图片\",\"段子\",\"投票\",\"排行\",\"互动区\",\"网红\",\"社会\",\"美女\",\"冷知识\",\"游戏\"]\n\u003e ######  let style = TGPageStyle()\n\u003e ######  style.isScrollEnable = true\n\u003e ######  style.isNeedTitleScale = true//缩放支持\n\u003e ######  style.isShowCoverView = true//用遮罩\n\n        \n#### 4 遮罩加跟踪滚动条，系统默认情况下使用遮罩时会隐藏底部的跟踪滚动条，若要同时有滚动条，则在设置遮罩后再设置滚动条\n\u003e ######  let titles = [\"推荐\",\"视频\",\"这是一个测试\",\"图片\",\"段子\",\"投票\",\"排行\",\"互动区\",\"网红\",\"社会\",\"美女\",\"冷知识\",\"游戏\"]\n\u003e ######  let style = TGPageStyle()\n\u003e ######  style.isScrollEnable = true\n\u003e ######  style.isNeedTitleScale = true\n\u003e ######  style.isShowCoverView = true \n\u003e ######  style.isShowBottomLine = true\n\n        \n#### 56789... 根据自己想要的效果自由配置style，如等分并缩放支持\n\u003e ######  let titles = [\"推荐\",\"视频\",\"图片\",\"段子\",\"投票\"]\n\u003e ######  let style = TGPageStyle()\n\u003e ######  style.isNeedTitleScale = true//缩放支持\n\u003e ######  style.bottomLineExtendWidth = 18//相当于inset，因为transform会影响frame，用bottomLineExtendWidth改变底部跟踪滚动条（下划线）的缩进\n\n\n#### `设置完pageViewFrame titles style 后就可以开始用了`\n\u003e ######  `var childVCs = [UIViewController]()`\n\u003e ######  for _ in 0..\u003ctitles.count {\n\u003e ######    let vc = UIViewController()\n\u003e ######    vc.view.backgroundColor = UIColor.random()\n\u003e ######    childVCs.append(vc)\n\u003e ######  }\n\u003e ######  let pageView = TGPageView(frame: pageViewFrame, titles: titles, titleStyle: style, childVCs: childVCs, parentVC: self)\n\u003e ######  view.addSubview(pageView)\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftargetcloud%2Ftgpageview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftargetcloud%2Ftgpageview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftargetcloud%2Ftgpageview/lists"}