Skip to content

wangxiaocan/UIShadow-UIView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

edd7676 · Jun 20, 2019

History

18 Commits
Jun 11, 2019
Jun 11, 2019
Jun 11, 2019
Jun 20, 2019
Jun 20, 2019

Repository files navigation

UIShadow-UIView

pod 导入

pod 'UIShadow+UIView'

或者解压下载的文件,拖入UIShadow+UIView文件夹到你的项目

使用时导入头文件 UIShadow+UIView.h

效果图

how to use

#import "UIShadow+UIView.h"

_coverImgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"cover.jpg"]];
_coverImgView.bounds = CGRectMake(0, 0, 240, 320);
_coverImgView.center = CGPointMake(CGRectGetWidth(self.view.frame) / 2, CGRectGetHeight(self.view.frame) / 2);
_coverImgView.shadow_opacity = 1.0;
_coverImgView.shadow_color = [UIColor redColor];
_coverImgView.shadow_offset = CGSizeZero;
_coverImgView.shadow_radius = 3.0;
_coverImgView.shadow_corner_radius = 6.0;
_coverImgView.showShadowLayer = YES;
[self.view addSubview:_coverImgView];
    
//    or use below function
//    [_coverImgView showDefaultShadow];

About

一键给UIImageView添加直角、圆角阴影

Resources

License

Stars

Watchers

Forks

Packages

No packages published