Demo_ButtonImageTitleEdgeInsets
这是一个使用 button 的 titleEdgeInsets 和 imageEdgeInsets 属性来实现在 button 文字图片上下或左右排列的 demo
现在可以使用 CocoaPods 安装了。在您的 podfile 中添加以下代码
pod 'LXMButtonImagePosition', '~> 1.1.1'
然后,在需要使用的地方引入头文件
#import <UIButton+LXMImagePosition.h>
更新
1.1.1
将支持的最低系统改为 iOS5.0;之前写的7.1是不必要的,这些属性在5.0之前就可以使用了。
1.1.0
加入对 contentInset 的考虑,以便正确计算 button 的 intrinsicSize,更好地配合自动布局
许可证
LXMButtonImagePosition 在 MIT 许可证下提供。有关详细信息,请参阅 LICENSE 文件。