AYViewCorner 1.0.1

AYViewCorner 1.0.1

测试已测试
语言语言 Obj-CObjective C
许可 MIT
发布最后发布2016年4月

AYJk 维护。



  • Andy

   

在不触发离屏渲染的情况下设置圆角

中文介绍

这是一个不触发离屏渲染设置圆角的小工具类。您可以轻松地将界面帧率保持在60fps左右,这样可以保证效果更平滑。

安装

推荐通过 CocoaPods

pod 'AYViewCorner'

运行 pod installpod update。这将会安装 AYViewCorner 的最新版本。

之后导入 <AYViewCorner/AYViewCorner.h>。

用法

UIButton

如果您想设置具有圆角的 UIButton,我建议调用以下方法:

- (void)ay_setCornerRadius:(AYRadius)cornerRadius setNormalImage:(UIImage *)normalImage highlightedImage:(UIImage *)highlightedImage disabledImage:(UIImage *)disableImage selectedImage:(UIImage *)selectedImage backgroundColor:(UIColor *)color;

UIView/UILabel

如果您想设置具有圆角的 UIView 或 UILabel,我建议调用以下方法:

- (void)ay_setCornerRadius:(AYRadius)cornerRadius backgroundColor:(UIColor *)color;

UIImageView

如果您想设置具有圆角的 UIImageView,我建议调用以下方法:

- (void)ay_setCornerRadius:(AYRadius)cornerRadius backgroundImage:(UIImage *)image backgroundColor:(UIColor *)color;

同时,如果您想设置 UIImageView 的 UIViewContentMode,我建议调用以下方法:

- (void)ay_setCornerRadius:(AYRadius)cornerRadius backgroundImage:(UIImage *)image backgroundColor:(UIColor *)color withContentMode:(UIViewContentMode)contentMode;

如果同时设置了图片和颜色,只会显示图片。

变更日志

v 1.0.1 修正了一些信息

v 1.0.0 第一个版本

许可

AYViewCorner 在 MIT 许可下提供。有关详细信息,请参阅 LICENSE 文件。

中文介绍

这是一个不触发离屏渲染设置圆角的工具类。你可以很容易的保持界面的FPS保持在60左右,足以保证流畅。

安装

推荐使用CocoaPods进行安装。

pod 'AYViewCorner'

然后输入 pod installpod update。将会安装最新版本的AYViewCorner。

最后导入头文件<AYViewCorner/AYViewCorner.h>

用法

UIButton

如果您想要设置 UIButton 的圆角,建议调用下面的方法:

- (void)ay_setCornerRadius:(AYRadius)cornerRadius setNormalImage:(UIImage *)normalImage highlightedImage:(UIImage *)highlightedImage disabledImage:(UIImage *)disableImage selectedImage:(UIImage *)selectedImage backgroundColor:(UIColor *)color;

UIView/UILabel

如果您想要设置 UIView/UILabel 的圆角,建议调用以下方法:

- (void)ay_setCornerRadius:(AYRadius)cornerRadius backgroundColor:(UIColor *)color;

UIImageView

如果您想要设置 UIImageView 的圆角,建议调用以下方法:

- (void)ay_setCornerRadius:(AYRadius)cornerRadius backgroundImage:(UIImage *)image backgroundColor:(UIColor *)color;

同时,如果您想设置 UIImageView 的 UIViewContentMode,建议调用以下方法:

- (void)ay_setCornerRadius:(AYRadius)cornerRadius backgroundImage:(UIImage *)image backgroundColor:(UIColor *)color withContentMode:(UIViewContentMode)contentMode;

如果同时设置图片和颜色,只会显示图片。

变更记录

v 1.0.1 修正了一些信息

v 1.0.0 首次提交

许可证

AYViewCorner 使用 MIT 许可证,详细信息请参阅 LICENSE 文件。