Giter Site home page Giter Site logo

imjerrybao / uiview-shadow-maker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from seitk/uiview-shadow-maker

0.0 2.0 0.0 120 KB

An UIView category that allow user to easily make inset shadow, customize the radius, alpha, color and directions.

Objective-C 100.00%

uiview-shadow-maker's Introduction

UIView-Shadow-Maker

An UIView category that allow user to easily make inset shadow, customize the radius, alpha, color and directions.
Shadows are drawn with CAGradient and added into an UIView with tag, remove viewWithTag in subviews to clear the shadow.
This project is an example, category file can be found in /Shadow Maker Example/Classes

Function
- (void) makeInsetShadow;
- (void) makeInsetShadowWithRadius:(float)radius Alpha:(float)alpha;
- (void) makeInsetShadowWithRadius:(float)radius Color:(UIColor *)color Directions:(NSArray *)directions;

Example
UIView *sampleView1 = [[UIView alloc] initWithFrame:CGRectMake(10, 10, 100, 100)];
[sampleView1 makeInsetShadowWithRadius:3.0 Alpha:0.4];
[self.view addSubview:sampleView1];

UIView *sampleView2 = [[UIView alloc] initWithFrame:CGRectMake(150, 100, 100, 200)];
[sampleView2 makeInsetShadowWithRadius:3.0 Color:[UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.4] Directions:[NSArray arrayWithObjects:@"top", @"bottom", nil]];
[self.view addSubview:sampleView2];

Screenshot
ScreenShot

Contribute
I'd love to include your contributions. Feel free to improve it, send comments or suggestions. Please let me know if you have great idea on it.

Contact Me
You can add me on Facebook - http://www.facebook.com/seitkk

uiview-shadow-maker's People

Contributors

seitk avatar

Watchers

 avatar  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.