{"id":26621635,"url":"https://github.com/zhitrend/seemore","last_synced_at":"2025-03-24T09:17:35.123Z","repository":{"id":87498988,"uuid":"134212280","full_name":"zhitrend/seeMore","owner":"zhitrend","description":"完成查看更多功能，要求与文字同一行。使用yykit，完成查看更多功能","archived":false,"fork":false,"pushed_at":"2018-06-13T07:53:01.000Z","size":5691,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-27T08:15:26.236Z","etag":null,"topics":[],"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/zhitrend.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-21T03:17:52.000Z","updated_at":"2019-03-31T14:30:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"aae2b14e-0abb-4d37-82e2-ea7206765e7c","html_url":"https://github.com/zhitrend/seeMore","commit_stats":null,"previous_names":["zhitrend/seemore"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhitrend%2FseeMore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhitrend%2FseeMore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhitrend%2FseeMore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhitrend%2FseeMore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhitrend","download_url":"https://codeload.github.com/zhitrend/seeMore/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245240835,"owners_count":20583102,"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":"2025-03-24T09:17:34.657Z","updated_at":"2025-03-24T09:17:35.087Z","avatar_url":"https://github.com/zhitrend.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n文字末尾点击查看更多展开所有内容\n\n通过yykit中的yylabel与富文本结合进行处理\n\n```\n- (void)addAllButton {\n    __weak typeof (self) _self = self;\n    // 需要拼接的内容\n    NSMutableAttributedString *text = [[NSMutableAttributedString alloc] initWithString:@\"...全部\"];\n    // 高亮点击模块 运用在tableview中可和百度开源的FD结合使用自适应cell高度\n    YYTextHighlight *hi = [YYTextHighlight new];\n    [hi setColor:[UIColor colorWithRed:0.578 green:0.790 blue:1.000 alpha:1.000]];\n    hi.tapAction = ^(UIView *containerView,NSAttributedString *text,NSRange range, CGRect rect) {\n        YYLabel *label = _self.label;\n        [label sizeToFit];\n    };\n    \n    // 全部：文字高亮\n    [text setColor:[UIColor colorWithRed:0.000 green:0.449 blue:1.000 alpha:1.000]range:[text.string rangeOfString:@\"全部\"]];\n    [text setTextHighlight:hi range:[text.string rangeOfString:@\"全部\"]];\n    text.font =_label.font;\n\n    YYLabel *seeMore = [YYLabel new];\n    seeMore.attributedText = text;\n    [seeMore sizeToFit];\n    // yylebel 添加到原label中\n    NSAttributedString *truncationToken = [NSAttributedString attachmentStringWithContent:seeMore contentMode:UIViewContentModeCenter attachmentSize:seeMore.frame.size alignToFont:text.font alignment:YYTextVerticalAlignmentCenter];\n    _label.truncationToken = truncationToken;\n}\n```\n\n\n\n\n![ACCA1CD7-EAC7-4EBD-B6E2-4789831C3C2E.png](https://upload-images.jianshu.io/upload_images/1775503-29875a03402c97eb.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)\n\n![0340046E-EF48-4B95-8B50-69E405BB1AE0.png](https://upload-images.jianshu.io/upload_images/1775503-28e38b5d5d7dc51d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhitrend%2Fseemore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhitrend%2Fseemore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhitrend%2Fseemore/lists"}