Latest 0.1.1
Homepage https://github.com/AlexHsieh/ButtonAppearance
License MIT
Platforms ios 7.0, requires ARC
Authors

[![CI Status](http://img.shields.io/travis/Alex Hsieh/ButtonAppearance.svg?style=flat)](https://travis-ci.org/Alex Hsieh/ButtonAppearance)
Version
License
Platform

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

If you need different border color or shadow color on different control state, subclass AHButton is required.

Button shadow changed with state

[self.buttonFromStoryBoard setShadowColor:shadowColor  offset:CGSizeMake(0, 3.0) opacity:1.0 radius:1.0 forState:UIControlStateNormal];
[self.buttonFromStoryBoard setShadowColor:buttonColor  offset:CGSizeMake(0, 3.0) opacity:1.0 radius:1.0 forState:UIControlStateHighlighted];

Button border changed with state

[self.buttonFromStoryBoard2 setCornerRadius:10.0 borderWidth:1.0 borderColor:[UIColor blackColor] forState:UIControlStateNormal];
[self.buttonFromStoryBoard2 setCornerRadius:10.0 borderWidth:1.0 borderColor:[UIColor grayColor] forState:UIControlStateHighlighted];

If you only need to change UIButton background color or background gradient on different control state, use category UIbutton+Appearance.

Button background color changed with state

[button3 setBackgroundColor:[UIColor yellowColor] forState:UIControlStateNormal];
[button3 setBackgroundColor:[UIColor greenColor] forState:UIControlStateHighlighted];

Button background gradient changed with state

[button4 setBackgroundGradient:@[[UIColor grayColor],[UIColor blackColor]] forState:UIControlStateNormal];
[button4 setBackgroundGradient:@[[UIColor lightGrayColor],[UIColor blackColor]] forState:UIControlStateHighlighted];

Requirements

ARC only; iOS 5.0+ / OSX 10.7+

Installation

via Cocoa pods
ButtonAppearance is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "ButtonAppearance"

Author

Alex Hsieh, [email protected]

License

ButtonAppearance is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "ButtonAppearance",
    "version": "0.1.1",
    "summary": "Use ButtonAppearance to setup Button appearance easily.",
    "description": "Simple as setup UIButton title text, this helps user easy setup background color, gradient, shadow and border for different control state",
    "homepage": "https://github.com/AlexHsieh/ButtonAppearance",
    "license": "MIT",
    "authors": {
        "Alex Hsieh": "[email protected]"
    },
    "source": {
        "git": "https://github.com/AlexHsieh/ButtonAppearance.git",
        "tag": "0.1.1"
    },
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "resource_bundles": {
        "ButtonAppearance": [
            "Pod/Assets/*.png"
        ]
    }
}

Pin It on Pinterest

Share This