Latest 0.0.2
Homepage https://github.com/czl0325/ZLImageTextButton
License MIT
Platforms ios , requires ARC
Authors

支持图左文右,图右文左,图上文下,图下文上4种模式的按钮,支持autolayout


12.12更新版本:
     1.修复了不能及时刷新的BUG。
     2.文字和图片增加了titleView和imageView的原生调用。

11.22更新版本:
     1.增加了cocoapods的支持。
     2.增加了CGSize zlImageSize属性,可以自定义图片的大小,防止图片过大的情况,如果没有定制,有默认的图片大小。

效果图

用法

//导入ZLImageTextButton的类
    #import "ZLImageTextButton.h"

    ZLImageTextButton* btn1 = [ZLImageTextButton buttonWithType:UIButtonTypeCustom];
    btn1.zlButtonType = ZLImageTopTextBottom;   //指定按钮的类型,未指定默认是图左问右
    [btn1 setImage:[UIImage imageNamed:@"image1"] forState:UIControlStateNormal];
    [btn1 setTitle:@"图上文下" forState:UIControlStateNormal];
    [self.view addSubview:btn1];
    [btn1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self.view);
        make.top.mas_equalTo(50);
        make.width.mas_equalTo(100);
        make.height.mas_equalTo(70);
    }];

Latest podspec

{
    "name": "ZLImageTextButton",
    "version": "0.0.2",
    "summary": "ZLImageTextButton",
    "description": "Image and text button",
    "platforms": {
        "ios": null
    },
    "homepage": "https://github.com/czl0325/ZLImageTextButton",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "czl0325": "[email protected]"
    },
    "source": {
        "git": "https://github.com/czl0325/ZLImageTextButton.git",
        "tag": "0.0.2"
    },
    "source_files": "demo/ZLImageTextButton/ZLImageTextButton/*.{h,m}",
    "requires_arc": true
}

Pin It on Pinterest

Share This