Latest 0.1.0
Homepage https://github.com/devxoul/UIButton-BackgroundContentMode
License MIT
Platforms ios 6.0, requires ARC
Frameworks Foundation, UIKit
Authors

CocoaPods

A missing background content mode for UIButton.

When to use?

scale-to-fill

Let’s assume that we have to set background image of UIButton. Like this:

;

Oh my god. Aspect ratio has broken. :weary:
It’s time to use UIButton+BackgroundContentMode to keep background image aspect ratio.

Installation

Use CocoaPods.

pod 'UIButton+BackgroundContentMode', '~> 0.1'

Usage

Import UIButton+BackgroundContentMode, then set backgroundContentMode of UIButton.

For example:

aspect-fit

button.backgroundContentMode = UIViewContentModeScaleAspectFit;

aspect-fill

button.backgroundContentMode = UIViewContentModeScaleAspectFill;

Finish! Set background image and enjoy coding. :tada:

License

UIButton+BackgroundContentMode is under MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "UIButton+BackgroundContentMode",
    "version": "0.1.0",
    "summary": "A missing background content mode for UIButton.",
    "homepage": "https://github.com/devxoul/UIButton-BackgroundContentMode",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "devxoul": "[email protected]"
    },
    "source": {
        "git": "https://github.com/devxoul/UIButton-BackgroundContentMode.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "6.0"
    },
    "requires_arc": true,
    "source_files": "UIButton+BackgroundContentMode/UIButton+BackgroundContentMode.{h,m}",
    "frameworks": [
        "Foundation",
        "UIKit"
    ]
}

Pin It on Pinterest

Share This