GithubHelp home page GithubHelp logo

chenzhenjg / ayviewcorner Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ayjk/ayviewcorner

0.0 2.0 0.0 1.81 MB

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

Home Page: http://ayjkdev.top/

License: MIT License

Ruby 1.72% Objective-C 98.28%

ayviewcorner's Introduction

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 文件。

ayviewcorner's People

Contributors

ayjk avatar

Watchers

James Cloos avatar zcdog avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.