Skip to content

ChaneyLau/UUButton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UUButton

License MIT  CocoaPods  CocoaPods 

UUButton

安装 [CocoaPods]

  1. pod "UUButton";
  2. pod install / pod update;
  3. #import <UUButton.h>.

使用说明

UUButton继承于UIButton,枚举内容(图片和文字)对齐方式,简化使用。用法和UIButton相同,只不过加了以下两个属性:

// 对齐方式
@property (nonatomic, assign) UUContentAlignment contentAlignment;
// 图文间距[默认5.0]
@property (nonatomic, assign) CGFloat spacing;
// 枚举
typedef NS_ENUM(NSInteger, UUContentAlignment) {
    UUContentAlignmentNormal = 0,                       //内容居中>>图左文右
    UUContentAlignmentCenterImageRight,                 //内容居中>>图右文左
    UUContentAlignmentCenterImageTop,                   //内容居中>>图上文右
    UUContentAlignmentCenterImageBottom,                //内容居中>>图下文上
    UUContentAlignmentLeftImageLeft,                    //内容居左>>图左文右
    UUContentAlignmentLeftImageRight,                   //内容居左>>图右文左
    UUContentAlignmentRightImageLeft,                   //内容居右>>图左文右
    UUContentAlignmentRightImageRight                   //内容居右>>图右文左
};

后记

不定时更新,如有问题欢迎给我留言,我会及时回复。如果这个工具对你有一些帮助,请给我一个star,谢谢。

About

简化UIButton的内容对其方式。

Resources

License

Stars

Watchers

Forks

Packages

No packages published