平時開發(fā)時總會有一些特殊的UI效果會比較煩人齿坷,比如單個邊的圓角,單個邊的陰影等等砖瞧,下面我們使用一種很easy的方式來完成
-
效果如圖:
使用方式:
-
Installation with CocoaPods:
pod 'YCShadowView'
#import <YCShadowView/YCShadowView.h>
-
Manual import:
- Drag the YCShadowView folder to project
#import "YCShadowView.h"
Use
YCShadowView *view = [[YCShadowView alloc] initWithFrame:CGRectMake(200, 250, 100, 100)];
view.backgroundColor = [UIColor whiteColor];
[view yc_shaodwRadius:10 shadowColor:[UIColor colorWithWhite:0 alpha:0.5] shadowOffset:CGSizeMake(0, 0) byShadowSide:(YCShadowSideRight)];
[view yc_cornerRadius:10 byRoundingCorners:(UIRectCornerBottomLeft)];
如有更好的方式來實現(xiàn)或不當之處颁湖,留言討論,感謝~
源碼見:github