DJWInsetFillButton 0.1.0

DJWInsetFillButton 0.1.0

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布最后发布2015年3月

Dan Williams 维护。




这是一个 UIButton 的替代品,在悬停时具有内向填充效果。允许以下样式

  • 边框颜色
  • 边框圆角半径
  • 高亮状态背景颜色
  • 字体
  • 普通控件状态的标题颜色采用视图的 tintColor 属性。

该类还设计用于 IB,完全支持 IB_Designable,并且每个属性都支持 IBInspectable。该类使用自动布局并需要基于约束的布局。

演示

Screenshot

用法

创建 DJWInsetFillButton 的新实例,就像创建任何其他视图一样。

  DJWInsetFillButton *button = [[DJWInsetFillButton alloc] init];
  button.title = @"Hello, world!";
  [self.view addSubView: button];

当按钮的标题更改时,按钮的内联内容大小会更新,以便它始终适当地调整大小。

安装

如果您正在使用 Cocoapods,只需将 DJWInsetFillButton 添加到您的 Podfile 即可。或者,将 DJWInsetFillButton.hDJWInsetFillButton.m 添加到您的项目中。此存储库中包含一个演示应用程序,展示了项目的工作方式。

许可证

DJWInsetFillButton 授权采用 MIT 许可证