Giter VIP home page Giter VIP logo

listdropmenu's Introduction

ListDropMenu

一款可自定义的DropDownMenuView

使用方法: -(void)initTopDropDownMenuView{

DropDownMenuConfig *config = [[DropDownMenuConfig alloc] init];
config.titles = @[@"全部",@"最新发布",@"拍卖中"];
config.titleNormalColor = [UIColor blackColor];
config.titleSelectedColor = [UIColor redColor];
config.titleFont = [UIFont systemFontOfSize:14.0];
config.imageNormalName = @"ic_pull_down";
config.imageSelectedName = @"ic_pull_up";
config.isShowVerLine = YES;
config.isShowBottomLine = YES;


///可自定义自己的选项视图  然后在DropDownView的dropDownMenuBtnAction:方法中获取对应的视图修改高度,回调等操作即可
NSMutableArray *arr = [NSMutableArray array];
for (int i = 0; i < 3; i++) {
    
    if (i == 0){
        SigleCollectionItemView *listView = [[SigleCollectionItemView alloc] initWithFrame:CGRectMake(0, 108, kWidth, 0)];
        listView.tagsArr = @[@"全部",@"�数码办公",@"家具用品",@"母婴用品",@"健康养生",@"户外休闲",@"尊享区"];

           //设置默认选中的item //listView.defaultCateName = self.cateModel.catName; [arr addObject:listView];

    }else if (i == 1){
        SigleTableListView *listView = [[SigleTableListView alloc] initWithFrame:CGRectMake(0, 108, kWidth, 0)];
        listView.dataArr = @[@"最新发布",@"价格从高到低",@"价格从低到高",@"出价次数由高到低"];

           //也可以设置默认选中某一个 需要将selectedRow属性暴露出来即可            [arr addObject:listView];

    }else if (i == 2) {
        SigleTableListView *listView = [[SigleTableListView alloc] initWithFrame:CGRectMake(0, 108, kWidth, 0)];
        listView.dataArr = @[@"拍卖中",@"即将拍卖",@"拍卖结束"];
        [arr addObject:listView];
        
    }
}


DropDownView *downView = [[DropDownView alloc] initWithFrame:CGRectMake(0, 64, kWidth, 44.0) config:config];
downView.backgroundColor = [UIColor whiteColor];
downView.itemViews = arr;

downView.didSelectedItemBlock = ^(DropDownView *UIView, NSString *title, NSInteger row, NSInteger tag) {
    NSLog(@"---- btnTag = %ld, row = %ld", tag , row);
};

[self.view addSubview:downView];

}

listdropmenu's People

Contributors

fxiaobin avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.