TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2017 |
Maintained by jprothwell.
一个简易的 筛选 工具条,适用于列表页顶部的筛选排序功能。
LPFilterMenuItem 筛选按钮基类
LPFilterMenuNormalItem
最基本的,正常的按钮
LPFilterMenuRepeatItem
适于于有两种selected状态的按钮。
LPFilterMenuSpecialItem
特殊的按钮,一般适用于排序条上的筛选功能,可以和其他按钮共存。
#import "LPFilter.h"
。可以在外界设置默认选中项
@property (nonatomic, assign) NSInteger firstClickIndex;
在外界创建按钮实例,并使用
@property (nonatomic, strong) NSArray <LPFilterMenuItem *> *lp_menuItems;
目前只能使用代理监听按钮的点击
@property (nonatomic, assign) id <LPFilterMenuViewDelegate> delegate;
+ (instancetype)filterMenuNormalItemWithTitle:(NSString *)title;
+ (instancetype)filterMenuNormalItemWithTitle:(NSString *)title image:(UIImage *)image selectedImage:(UIImage *)selectedImage;
LPFilterMenuRepeatItemTypeNormal, //正常状态
LPFilterMenuRepeatItemTypeSelected, //第一种选中状态
LPFilterMenuRepeatItemTypeRepeatSelected, //第二种选中状态
//外界可以使用这个用来判断按钮的状态
@property (nonatomic, assign) LPFilterMenuRepeatItemType type;
这个类很特殊,因为适用于筛选按钮,请在外界手动调整按钮的选中状态。
//切换选中状态 - (void)selectedState;
//切换正常状态 - (void)normalState;
注意 : 这两个方法只针对特殊按钮有用。