Code Monkey home page Code Monkey logo

qbflatbutton's Introduction

QBFlatButton

Flat-Style Button

Installation

QBFlatButton can be installed with CocoaPods.

pod 'QBFlatButton'

Or clone this repository and include QBFlatButton.h in your project manually.

ScreenShot

screenshot.png

Properties

faceColor

A surface color of the button.

@property (nonatomic, strong) UIColor *faceColor

sideColor

A side color of the button.

@property (nonatomic, strong) UIColor *sideColor

borderColor

A border color of the button.

@property (nonatomic, strong) UIColor *borderColor

cornerRadius

A corner radius of the button.

@property (nonatomic, assign) CGFloat cornerRadius

height

A button height in normal state.

@property (nonatomic, assign) CGFloat height

depth

A button depth when the button pushed down.

@property (nonatomic, assign) CGFloat depth

borderWidth

A border width of the button.

@property (nonatomic, assign) CGFloat borderWidth

Example

QBFlatButton *button = [QBFlatButton buttonWithType:UIButtonTypeCustom];
button.frame = CGRectMake(90, 200, 140, 50);

button.surfaceColor = [UIColor colorWithRed:0.333 green:0.631 blue:0.851 alpha:1.0];
button.sideColor = [UIColor colorWithRed:0.310 green:0.498 blue:0.702 alpha:1.0];
button.borderColor = [UIColor colorWithRed:0.310 green:0.498 blue:0.702 alpha:1.0];

button.cornerRadius = 6.0;
button.height = 4.0;
button.depth = 3.0;

button.titleLabel.font = [UIFont boldSystemFontOfSize:16.0];
[button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[button setTitle:@"QBFlatButton" forState:UIControlStateNormal];

[self.view addSubview:button];

License

QBFlatButton is released under the MIT License, see LICENSE.txt.

qbflatbutton's People

Contributors

nek023 avatar shu223 avatar jstart avatar

Watchers

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