TinyQ / TQEasyIconButton

Easy set icon to UIButton with left,right,top,bottom icon

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TQEasyIconButton

TQEasyIconButton is a UIButton Category. Easy way to set titleEdgeInsets,imageEdgeInsets make icon in left,right,top,bottom.

Demo

image

Installation

lib is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "TQEasyIconButton"

Usage

  1. Set icon & title for button.

    [self.demoButton setTitle:@"Button" forState:UIControlStateNormal];
    [self.demoButton setImage:@"icon" forState:UIControlStateNormal];
    
  2. Set icon left,title right

    image

    [self.demoButton setIconInLeft];
    // or
    //[self.demoButton setIconInLeftWithSpacing:0];
    

    image

    [self.demoButton setIconInRight];
    // or
    //[self.demoButton setIconInRightWithSpacing:0];
    

    image

    [self.demoButton setIconInBottom];
    // or
    //[self.demoButton setIconInBottomWithSpacing:0];
    

    image

    [self.demoButton setIconInTop];
    // or
    //[self.demoButton setIconInTopWithSpacing:0];
    

About

Easy set icon to UIButton with left,right,top,bottom icon

License:MIT License


Languages

Language:Objective-C 94.0%Language:Ruby 6.0%