Skip to content

About

CollectionView做的两级菜单,可以折叠第二级菜单

Resources

Stars

1.5k stars

Watchers

44 watching

Forks

Repository files navigation

CollectionViewClassifyMenu

功能展示

Example screenshot

单选可折叠菜单的特性展示

Example screenshot

Check out my weibo for more info.

然并卵? 请看以下应用场景:

场景一:《手机淘宝App》

筛选条件,如果数目过多,可以折叠,:比如《手机淘宝App》中商品的评价筛选

enter image description here

场景二:《脉脉App》

分类菜单:比如《脉脉App》中的搜索分类筛选

enter image description here

Demo中具有两种样式

第一种是CollectionView做的两级菜单,可以折叠第二级菜单

第二种是侧边栏菜单,具有多选功能,并可将数据持久化,在下次打开app后,保留用户的筛选条件.默认保存.

数据持久化使用NSCoding,若要关闭该项功能,可在AppDelegate里清除固化数据,

清除方法已经在工程中写出:

- (void)initFilterSetting:(BOOL)restore
{
    if (!restore) {
        CYLFilterParamsTool *filterParamsTool = [[CYLFilterParamsTool alloc] init];
        [NSKeyedArchiver archiveRootObject:filterParamsTool toFile:filterParamsTool.filename];
    }
}

用法如下

YES为保存,NO为不保存.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    //...
    //设NO表示,每次启动程序,清除用户上次的筛选条件,不写该行,默认保存.
    [self initFilterSetting:NO];
    return YES;
}

Check out my twitter for more info.

About

CollectionView做的两级菜单,可以折叠第二级菜单

Resources

Stars

1.5k stars

Watchers

44 watching

Forks

Releases

Packages

Contributors

Languages