{"id":26214404,"url":"https://github.com/ljunb/zelda","last_synced_at":"2025-04-15T18:41:46.338Z","repository":{"id":56931488,"uuid":"395902246","full_name":"ljunb/Zelda","owner":"ljunb","description":"支持链式语法的轻量FlexBox布局库","archived":false,"fork":false,"pushed_at":"2021-08-17T13:53:49.000Z","size":28,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T23:44:02.652Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ljunb.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}},"created_at":"2021-08-14T05:32:30.000Z","updated_at":"2021-08-24T06:57:52.000Z","dependencies_parsed_at":"2022-08-21T00:00:32.780Z","dependency_job_id":null,"html_url":"https://github.com/ljunb/Zelda","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ljunb%2FZelda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ljunb%2FZelda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ljunb%2FZelda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ljunb%2FZelda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ljunb","download_url":"https://codeload.github.com/ljunb/Zelda/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249130942,"owners_count":21217639,"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-12T10:16:55.232Z","updated_at":"2025-04-15T18:41:46.314Z","avatar_url":"https://github.com/ljunb.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zelda\n\n[![CI Status](https://img.shields.io/travis/ljunb/Zelda.svg?style=flat)](https://travis-ci.org/ljunb/Zelda)\n[![Version](https://img.shields.io/cocoapods/v/Zelda.svg?style=flat)](https://cocoapods.org/pods/Zelda)\n[![License](https://img.shields.io/cocoapods/l/Zelda.svg?style=flat)](https://cocoapods.org/pods/Zelda)\n[![Platform](https://img.shields.io/cocoapods/p/Zelda.svg?style=flat)](https://cocoapods.org/pods/Zelda)\n\n`Zelda` 是一个支持链式语法的 FlexBox 布局库，是针对 [YogaKit](https://github.com/facebook/yoga/tree/main/YogaKit) 的二次封装，可以快速的让 iOS 原生开发人员使用 FlexBox 技术进行\nUI 布局。\n\n## 安装\n```ruby\npod 'Zelda'\n```\n\n## 简单使用\n```objc\n#import \u003cZelda/UIView+Zelda.h\u003e\n\nUIView *container = [UIView new];\ncontainer.backgroundColor = UIColor.redColor;\n[self.view addSubview:container];\ncontainer\n    .zelda\n    .flexDirection(ZDFlexDirectionRow)\n    .alignItems(ZDAlignCenter)\n    .margin(100)\n    .height(100)\n    .width(100);\n\nUIView *view1 = [UIView new];\nview1.backgroundColor = UIColor.grayColor;\n[container addSubview:view1];\nview1.zelda.height(30).width(30);\n\nUIView *view2 = [UIView new];\nview2.backgroundColor = UIColor.blueColor;\n[container addSubview:view2];\nview2.zelda.height(30).width(30).marginHorizontal(10);\n\n[container.zelda applyLayout];\n```\n\n以 `per_` 开头使用百分比数值：\n```objc\nUIView *view = [UIView new];\n// 代表宽高分别占据父组件的30%、10%\nview.zelda.per_width(30).per_height(10);\n```\n\n以 `zd_` 开头获取当前组件的布局数值：\n```objc\nUIView *view = [UIView new];\nview.zelda.width(30).height(30);\nCGFloat height = view.zelda.zd_height;\n// todo something...\n\n```\n## 运行示例\n```shell\ngit clone git@github.com:ljunb/Zelda.git\ncd Zelda/Example \u0026\u0026 pod install\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fljunb%2Fzelda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fljunb%2Fzelda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fljunb%2Fzelda/lists"}