JLGradientViews 0.2.0

JLGradientViews 0.2.0

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布日期最后发布日期2016年12月

Joey Lee 维护。



  • Joey Lee

示例

要运行示例项目,请克隆仓库,然后在 Example 目录中首先运行 pod install

要求

安装

JLGradientViews 可通过 CocoaPods 获取。要安装它,只需将以下行添加到 Podfile 中

pod "JLGradientViews"

使用

1. 在 Interface Builder 中打开 Storyboard 或 xib。
2. 添加一个视图。

3. 改变类的名称。

4. 设置渐变颜色和点。
  • 点值应该介于 0.0 ~ 1.0 之间。
  • 例如,(0,0) 表示左上角。 (1,1) 表示右下角。

5. 如果您对设置每个视图的起点和终点太懒惰,那么 JLVerticalGradientView 和 JLHorizontalGradientView 也对您可用。:D

6. 如果您喜欢编码,调用 updateColorupdatePoint 来在视图中反映数据是很重要的。
JLHorizontalGradientView *gradientView = [[JLHorizontalGradientView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
gradientView.leftColor = [UIColor whiteColor];
gradientView.rightColor = [UIColor blackColor];
[gradientView updateColor];
[self.view addSubview:gradientView];
7. Enjoy and be happy!

作者

Joey Lee

许可证

JLGradientViews 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。