Giter Club home page Giter Club logo

yiinnershadowview's Introduction

YIInnerShadowView

Inner-shadow UIView/CALayer for iOS.

ScreenShot1

How to use

YIInnerShadowView* innerShadowView = [[YIInnerShadowView alloc] initWithFrame:frame];
innerShadowView.shadowRadius = 5;
innerShadowView.shadowMask = YIInnerShadowMaskVertical;
[self.view addSubview:innerShadowView];

YIInnerShadowMask

typedef enum {
    YIInnerShadowMaskNone       = 0,
    YIInnerShadowMaskTop        = 1 << 1,
    YIInnerShadowMaskBottom     = 1 << 2,
    YIInnerShadowMaskLeft       = 1 << 3,
    YIInnerShadowMaskRight      = 1 << 4,
    YIInnerShadowMaskVertical   = YIInnerShadowMaskTop | YIInnerShadowMaskBottom,
    YIInnerShadowMaskHorizontal = YIInnerShadowMaskLeft | YIInnerShadowMaskRight,
    YIInnerShadowMaskAll        = YIInnerShadowMaskVertical | YIInnerShadowMaskHorizontal
} YIInnerShadowMask;

Acknowledgement

Main idea is from Matt Wilding:

http://stackoverflow.com/questions/4431292/inner-shadow-effect-on-uiview-layer

License

YIInnerShadowView is available under the Beerware license.

If we meet some day, and you think this stuff is worth it, you can buy me a beer in return.

yiinnershadowview's People

Contributors

inamiy avatar elitalon avatar esakuda avatar croig-bv avatar

Stargazers

 avatar  avatar 0x1306a94 avatar  avatar Alex Zavatone avatar 琥珀 avatar ramazan demir avatar DAO avatar LWZ avatar  avatar HuangMS-War avatar Nikolaus Heger avatar Norld avatar mono — Masayuki Ono avatar Tim Kersey avatar Pavel Sorokin avatar Auk513 avatar Vitaliy Voropaev avatar MWCao avatar Tim avatar  avatar xiajun.wang avatar sablib avatar __status302 avatar Yegucheng avatar Alex avatar  avatar Yevgeniy Zakharov avatar Maxim avatar IROYCN avatar Noah avatar Jaroslav Zheleznov avatar Stanislas Chevallier avatar sealedace avatar BigPanda avatar meimei avatar  avatar Ostap Romanko avatar Shyngys Kassymov avatar Chirag Bhaiji avatar  avatar Abner avatar  avatar  avatar Xi Lin avatar dawenhing avatar thomas avatar Fraker.XM avatar  avatar  avatar  avatar Andrei Radulescu avatar Catch Zeng avatar Hiroki Nagasawa avatar Tassel avatar  avatar Yuheng avatar Econa77 avatar Omar avatar Denis Morentsov avatar Kyle Howells avatar  avatar Delonn avatar L# avatar  avatar Song Zhou avatar Angus H. avatar Maxime Mouchet avatar  avatar  avatar Romeu Godoi avatar Perry avatar DJ Mason avatar ThomasW avatar  avatar Ryan McLeod avatar  avatar John Manos avatar  avatar Jairo Barros avatar Wiktor Gworek avatar Serdar Karatekin avatar Morgan Jones avatar Keita Ojima avatar Serhat Sezer avatar Joao daSilva avatar Kyle Langille avatar  avatar Bassem Tourky avatar vara avatar Genady Okrain avatar Wolfgang Muhsal avatar haley. avatar  avatar kaiinui avatar Picker Weng avatar Cleber Santos avatar Hemang avatar zhuqling avatar Orr Matarasso avatar

Watchers

 avatar mayulu avatar James Cloos avatar Jianfeng Wu avatar  avatar

yiinnershadowview's Issues

Release new pod

The existing version out of date (missing cornerRadius accessor). Can you release a new Cocoapod?

Can I hide the layer border?

Hi

I set the layer's border width to 0, but it's still has a border.

my code:

YIInnerShadowLayer *innerShadowLayer = [YIInnerShadowLayer layer];
        innerShadowLayer.actions = [NSDictionary dictionaryWithObjectsAndKeys:
                                    [NSNull null], @"position",
                                    [NSNull null], @"bounds",
                                    [NSNull null], @"contents",
                                    [NSNull null], @"shadowColor",
                                    [NSNull null], @"shadowOpacity",
                                    [NSNull null], @"shadowOffset",
                                    [NSNull null], @"shadowRadius",
                                    nil];
        self.layer.borderWidth = 0;
        [self.layer addSublayer:innerShadowLayer];
        self.layer.masksToBounds = YES;
        innerShadowLayer.shadowRadius = 3.0f;
        innerShadowLayer.shadowColor = [UIColor blueColor].CGColor;
        innerShadowLayer.borderWidth = 0;
        innerShadowLayer.shadowOpacity = 0.7f;
        self.innerShadowLayer = innerShadowLayer;

how could i set property to hide the border? thanks!

Carthage support

Hi. Nice lib. It would be very comfortable if this lib is accesible with carthage dependency manager

no shadow on 64bit-devices?

it's working perfect on iOS 7.0 and 7.1, but I've got problems on 64bit-devices - the shadow isn't displayed at all; neither on the device nor in the simulator

Leak in layourSublayers

In the layoutSublayers method of YIInnerShadowLayer.m, the clang analyzer points out a leak of the CGMutablePathRef variable "path".

According to Apple docs on the function CGPathCreateMutable(), the function creates "A new mutable path. You are responsible for releasing this object."

A simple fix is to add

CGPathRelease(path); 

as the last line of the method, following the line

[self setpath:path];

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.