{"id":18880831,"url":"https://github.com/keenteam1990/kttableviewroll","last_synced_at":"2026-02-20T20:30:19.957Z","repository":{"id":107584374,"uuid":"131860793","full_name":"KeenTeam1990/KTTableviewRoll","owner":"KeenTeam1990","description":"🍆KTTableviewRoll","archived":false,"fork":false,"pushed_at":"2018-05-02T14:21:37.000Z","size":55,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-31T03:23:25.444Z","etag":null,"topics":["rolling"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KeenTeam1990.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-02T14:13:58.000Z","updated_at":"2020-03-06T01:28:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"9da64e27-0e13-46f1-a11e-a3107e3e1dd0","html_url":"https://github.com/KeenTeam1990/KTTableviewRoll","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeenTeam1990%2FKTTableviewRoll","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeenTeam1990%2FKTTableviewRoll/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeenTeam1990%2FKTTableviewRoll/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeenTeam1990%2FKTTableviewRoll/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KeenTeam1990","download_url":"https://codeload.github.com/KeenTeam1990/KTTableviewRoll/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239848054,"owners_count":19707079,"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":["rolling"],"created_at":"2024-11-08T06:46:10.012Z","updated_at":"2026-02-20T20:30:19.897Z","avatar_url":"https://github.com/KeenTeam1990.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KTTableviewRoll\n电商轮播标题广告（仿京东、淘宝）\n![项目效果图](https://github.com/KeenTeam1990/KTTableviewRoll/blob/master/pic/icon.png)\n\n实现方面，我利用UIView animateWithDuration结合CALayer的CATransform3D坐标变换做上下翻滚动画。\n\n#pragma mark - 标题滚动\n- (void)titleRolling{\n    \n    if (self.saveMiddleArray.count \u003e 1) { //所存的每组滚动\n        __weak typeof(self)weakSelf = self;\n        \n        [UIView animateWithDuration:self.rollingTime animations:^{\n            \n            [self getMiddleArrayWithIndex:0 WithAngle:- M_PI_2 Height:- RollingViewHeight / 2]; //第0组\n            \n            [self getMiddleArrayWithIndex:1 WithAngle:0 Height:0]; //第一组\n            \n        } completion:^(BOOL finished) {\n            \n            if (finished == YES) { //旋转结束\n                UIButton *newMiddleView = [weakSelf getMiddleArrayWithIndex:0 WithAngle:M_PI_2 Height: -RollingViewHeight / 2];\n                [weakSelf.saveMiddleArray addObject:newMiddleView];\n                \n                [weakSelf.saveMiddleArray removeObjectAtIndex:0];\n            }\n        }];\n    }\n    \n}\n\n#pragma mark - CATransform3D翻转\n- (UIButton *)getMiddleArrayWithIndex:(NSInteger)index WithAngle:(CGFloat)angle Height:(CGFloat)height\n{\n    if (index \u003e _saveMiddleArray.count) return 0;\n    UIButton *middleView = self.saveMiddleArray[index];\n    \n    CATransform3D trans = CATransform3DIdentity;\n    trans = CATransform3DMakeRotation(angle, 1, 0, 0);\n    trans = CATransform3DTranslate(trans, 0, height, height);\n    middleView.layer.transform = trans;\n    \n    return middleView;\n}\n\n\n如果这个Demo让你有所收获，请Star and Fork。\n\n注：如果遇到问题还请Issues,我会尽快回复。\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeenteam1990%2Fkttableviewroll","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeenteam1990%2Fkttableviewroll","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeenteam1990%2Fkttableviewroll/lists"}