Coder Social home page Coder Social logo

iltranslucentview's Introduction

ILTranslucentView (iOS)

ILTranslucentView is a little subclass of UIView that provide native iOS 7+ blur (translucent) effect. It can be used on all iOS devices in real time without any performance problems. It also supports smooth UIView animation of color, frame, alpha etc.

How to use it

  • add ILTranslucentView.h and ILTranslucentView.m from Source folder to your project
  • use it as normal UIView but with additional methods/propertiers:
    ILTranslucentView *translucentView = [[ILTranslucentView alloc] initWithFrame:CGRectMake(0, 0, 250, 150)];
    [self.view addSubview:translucentView]; //that's it :)
    
    //optional:
    translucentView.translucentAlpha = 1;
    translucentView.translucentStyle = UIBarStyleDefault;
    translucentView.translucentTintColor = [UIColor clearColor];
    translucentView.backgroundColor = [UIColor clearColor];

translucentAlpha

The translucent's alpha value. The value of this property is a floating-point number in the range 0.0 to 1.0, where 0.0 represents view without translucent effect and 1.0 represents maximum translucent effect.
Notice: If translucentAlpha is not set to 1.0, view may lose blur effect.

translucentStyle

ILTranslucentView uses UIToolbar to provide translucent effect. This property specifies its appearance.

translucentTintColor

The tint color to apply to the translucent color.

backgroundColor

For iOS 6-, this is the view’s background color. For iOS 7+ it represents background color of layer above translucent layer.

Example:

ILTranslucentView_examples

iOS 6 and lower?

It works but without translucent effect. Behaves as a regular UIView. Try using some opacity on backgroundColor instead.

Storyboard or XIB

In Identity Inspector just add Custom Class: ILTranslucentView.

ILTranslucentView_examples

iltranslucentview's People

Contributors

ivoleko avatar jasonconnery avatar

Watchers

James Cloos 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.