Skip to content

namanhams/FlexibleAlignButton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FlexibleAlignButton

UIButton subclass that supports flexible text/image alignment.
The default UIButton only supports horizontal alignment with image to the left and text to the right. This is kind of restricted. What if you want image to the right and text to the left ? Or you want them to be displayed vertically ? Then this custom UIButton is for you.

There's a sample project to show case.

Example

![alt text](http://imageshack.com/a/img540/5046/jK4RKq.png "Image top Text bottom") ![alt text](http://imageshack.com/a/img673/2019/Q8nS72.png "Text top Image bottom") ![alt text](http://imageshack.com/a/img905/9017/qJufe8.png "Text left Image top")

Usage

``` FlexibleAlignButton *btn = ..... btn.alignment = kButtonAlignmentLabelLeft; btn.gap = 5; // gap between text and image ```

Features

- Support vertical/horizontal alignment - Also handles calculating frame for attributed text. - Supports iOS 5 and above, ARC/non-ARC projects

About

UIButton subclass that allows flexible image/text alignment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published