CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.
TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Feb 2018 |
Maintained by Joslyn wu, Joslyn.
一个UIButon的派生类,可以调整图片与文字相对位置,图片和文字间距,以及图片显示大小。
pod 'CSButton'
CSButton.h
CSButton.m
1、 调整图片与文字相对位置,
配置cs_buttonImagePositionType
属性即可。
@property (nonatomic, assign) CSButtonImagePositionType cs_buttonImagePositionType;
该属性为枚举类型:
typedef NS_ENUM(NSInteger, CSButtonImagePositionType) {
CSButtonImagePositionTypeDefault,
CSButtonImagePositionTypeRight,
CSButtonImagePositionTypeTop,
CSButtonImagePositionTypeBottom
};
2、 调整图片与文字间的距离,
配置cs_middleDistance
属性即可。
@property (nonatomic, assign) CGFloat cs_middleDistance;
3、 调整图片展示大小,
配置cs_imageViewSize
属性即可。
@property (nonatomic, assign) CGSize cs_imageViewSize;
adjustsImageWhenHighlighted
为YES
。git clone --recursive https://github.com/chenaiwubu/CSButton.git