MPSFollowButton 1.0.0

MPSFollowButton 1.0.0

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

Matthew Strickland 维护。



  • 作者:
  • Matthew Strickland

一个 UIButton 子类,模仿了 iOS 7 上 Instagram 中的 Follow 按钮。

安装

如果您正在使用 CocoaPods,只需将以下行添加到您的 Podfile:

pod 'MPSFollowButton'

示例

Screenshot

使用方法

使用 MPSFollowButton 非常简单。您只需要创建一个,将其添加到您的视图中,然后切换不同的状态。

更多示例,请查看此处仓库中的示例项目,如果您发现任何问题,请提交 issue。

To toggle one of the states use one of the following methods on an instance of a MPSFollowButton.

- (void)setFollow;

- (void)setFollowWithText:(NSString *)titleLabelText;

- (void)setFollowing;

- (void)setFollowingWithText:(NSString *)titleLabelText;

- (void)setLoading;

- (void)setLoadingWithText:(NSString *)titleLabelText;

定制

MPSFollowButton 可以通过多种方式定制。您可以为正常和选中状态自定义按钮的前景和背景颜色

@property (nonatomic, strong) UIColor *followBackgroundColor;

@property (nonatomic, strong) UIColor *followingBackgroundColor;

@property (nonatomic, strong) UIColor *loadingBackgroundColor;

@property (nonatomic, strong) UIColor *followForegroundColor;

@property (nonatomic, strong) UIColor *followingForegroundColor;

@property (nonatomic, strong) UIColor *loadingForegroundColor;

鸣谢

感谢 Instagram 提供灵感 :)

联系方式

许可证

查看 LICENSE