sandouchen / AYViewCorner

set round corner without offscreen rendered / 不触发离屏渲染的设置圆角

Home Page:http://ayjkdev.top/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AYViewCorner

LICENSE  CocoaPods Version BLOG 

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

中文介绍

This is a utility class which can help you set round corner without offScreen rendered. You can easily hoding frames at 60fps, the effect looks more smoother than layer.cornerRadius.

Installation

The perferred way of installation is via CocoaPods

pod 'AYViewCorner'

and run pod install or pod update. It will install the most recent version of AYViewCorner.

After that import <AYViewCorner/AYViewCorner.h>.

Use AYViewCorner

使用AYViewCorner

Use CornerRadius

使用CornerRadius

Usage

UIButton

If you want set UIButton with round corner, I suggest you invoke:

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

UIView/UILabel

If you want set UIView or UILabel with round corner, I suggest you invoke:

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

UIImageView

If you want set UIImageView with round corner, I suggest you invoke:

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

At the same time, if you want to set UIViewContentMode with UIImageView,I suggest you invoke:

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

If both the image and color are set ,it only show the image.

Changelog

v 1.0.1 fix some info

v 1.0.0 first version

License

AYViewCorner is provided under the MIT license. See LICENSE file for details.

=================

中文介绍

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

安装

推荐使用CocoaPods进行安装。

pod 'AYViewCorner'

然后输入 pod install or pod 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 文件。

About

set round corner without offscreen rendered / 不触发离屏渲染的设置圆角

http://ayjkdev.top/

License:MIT License


Languages

Language:Objective-C 98.3%Language:Ruby 1.7%