TezButton 0.4

TezButton 0.4

测试已测试
语言语言 Obj-CObjective C
许可协议 MIT
发布最新发布2019年5月

TezButton 维护。




  • Tez Park

Platform GitHub language Version License Travis build

TezButton

自定义 UIButton

简介

  • TezButton 非常容易支持自定义按钮的使用。
  • 包含的按钮类型包括:
    • 标题、字体
    • 圆角
    • 加粗
    • 下划线
    • 右图/左标签
    • 顶部图像/左标签
  • 支持 Inspector Builder

截图

example

安装

CocoaPods

TezButton 可通过 CocoaPods 获取。要安装它,请简单地将以下行添加到您的 Podfile 中

pod "TezButton"

用法

程序化

// All options (Tezbutton superclass)
    TezButton* allOptBtn = [[TezButton alloc] initWithFrame:frame
                                             roundingCorner:YES
                                                allBoldText:YES
                                                     border:YES
                                                 titleColor:colorText
                                            backgroundColor:colorWhite
                                              magnification:1
                                                   fontSize:12
                                               cornerRadius:8
                                               cornerOption:UIRectCornerAllCorners];
    [allOptBtn setTitle:@"TezButton Superclass (All option)" forState:UIControlStateNormal];
    
    // fontsize, bold option
    GreenButton* titleOptBtn = [[GreenButton alloc] initWithFrame:frame
                                                         fontSize:14
                                                      allBoldText:YES];
    [titleOptBtn setTitle:@"FontSize, Bold" forState:UIControlStateNormal];
    
    // Title, bold option
    RedButton* titleOptBtn2 = [[RedButton alloc] initWithFrame:frame
                                                         title:@"Title, Bold"
                                                   allBoldText:YES];
    
    // Title, font option
    SkyBlueButton* titleOptBtn3 = [[SkyBlueButton alloc] initWithFrame:frame
                                                                 title:@"Title, Font"
                                                                  font:[UIFont boldSystemFontOfSize:12]];
    
    // titleColor, fontsize, bold option
    OrangeButton* titleOptBtn4 = [[OrangeButton alloc] initWithFrame:frame
                                                          titleColor:colorText
                                                            fontSize:14
                                                         allBoldText:YES];
    [titleOptBtn4 setTitle:@"TitleColor, FontSize, Bold" forState:UIControlStateNormal];
    
    // Corner, Radius option
    BlueButton* cornerOptBtn = [[BlueButton alloc] initWithFrame:frame
                                                  roundingCorner:YES
                                                    cornerRadius:15];
    [cornerOptBtn setTitle:@"Corner, Radius" forState:UIControlStateNormal];
    
    // Corner, RectCorner, Radius options
    YellowButton* cornerOptBtn2 = [[YellowButton alloc] initWithFrame:frame
                                                       roundingCorner:YES
                                                         cornerRadius:15
                                                         cornerOption:UIRectCornerTopLeft|UIRectCornerBottomRight];
    [cornerOptBtn2 setTitle:@"Corner, RectCorner, Radius" forState:UIControlStateNormal];
    
    // Corner, Radius, Bolder
    PurpleButton* cornerOptBtn3 = [[PurpleButton alloc] initWithFrame:frame
                                                       roundingCorner:YES
                                                         cornerRadius:15
                                                               border:YES];
    [cornerOptBtn3 setTitle:@"Corner, Radius, Bolder" forState:UIControlStateNormal];
    
    
    // Bottom label button
    BottomLabelButton* bottomLabelBtn = [[BottomLabelButton alloc] initWithFrame:frame contentGap:5];
    
    // Left label button
    LeftLabelButton* leftLabelButton = [[LeftLabelButton alloc] initWithFrame:frame contentGap:5];
    
    // Include Data option
    IncludeDataButton* includeDataBtn = [[IncludeDataButton alloc] initWithFrame:frame];
    [includeDataBtn setData:[NSDictionary new]];
    
    // Underline option
    UnderlineButton* underlineBtn = [[UnderlineButton alloc] initWithFrame:frame];

检查器构建器

inspector_builder_tezbutton

许可协议

MIT 许可协议 (MIT)

版权所有 © 2017 Taesun Park

任何人未经许可均可自由获得此软件及其相关文档文件(以下简称“软件”)的副本,不受任何限制地处理该软件,包括但不限于使用、复制、修改、合并、发布、分发、再许可和/或出售该软件的副本,并允许向提供该软件的个人进行此类处理,前提是遵守以下条件

上述版权声明和本许可声明应包含在软件副本的全部或大部分内容中。

软件按“现状”提供,不提供任何明示或暗示的保证,包括但不限于对适销性、特定用途适用性和非侵权的保证。在任何情况下,作者或版权所有者不对任何要求、损害或其他责任承担责任,无论源于合同、侵权或其他责任,无论源于软件、使用或以其他方式使用软件或与软件一起使用。