GithubHelp home page GithubHelp logo

Comments (4)

bestwnh avatar bestwnh commented on August 26, 2024

Just try to adjust the order of dropdowns.(For example, change the order that the dropdown added to view or use - (void)insertSubview:(UIView *)view belowSubview:(UIView *)siblingSubview, - (void)insertSubview:(UIView *)view aboveSubview:(UIView *)siblingSubview,- (void)bringSubviewToFront:(UIView *)view, - (void)sendSubviewToBack:(UIView *)view)

If you're in some other situation, please provide more information or some sample code.

from igldropdownmenu.

MattFedo avatar MattFedo commented on August 26, 2024

Try using the provided code. It does not work properly. Only one menu will show when both are clicked.

  • (void) LoadDropDown{
    NSArray *dataArray = @[@{@"image":@"",@"title":@"Education"},
    @{@"image":@"",@"title":@"Nutrition"},
    @{@"image":@"",@"title":@"Equipment"},
    @{@"image":@"",@"title":@"Exercises"},
    @{@"image":@"",@"title":@"Admissions"},
    @{@"image":@"",@"title":@"Dressing Changes"},];
    NSMutableArray *dropdownItems = [[NSMutableArray alloc] init];
    for (int i = 0; i < dataArray.count; i++) {
    NSDictionary *dict = dataArray[i];
    IGLDropDownItem *item = [[IGLDropDownItem alloc] init];
    [item setIconImage:[UIImage imageNamed:dict[@"image"]]];
    [item setText:dict[@"title"]];
    [dropdownItems addObject:item];
    }

    IGLDropDownMenu *drop1 = [[IGLDropDownMenu alloc] init];
    drop1.menuText = @"Categories...";
    drop1.dropDownItems = dropdownItems;
    drop1.paddingLeft = 15;
    drop1.frame = CGRectMake(10, 10, 50, 40);
    drop1.delegate = self;
    drop1.type = IGLDropDownMenuTypeStack;
    drop1.flipWhenToggleView = YES;
    [drop1 reloadView];
    [self.view addSubview:drop1];

    IGLDropDownMenu *drop2 = [[IGLDropDownMenu alloc] init];
    drop2.menuText = @"Categories...";
    drop2.dropDownItems = dropdownItems;
    drop2.frame = CGRectMake(200, 10, 200, 40);
    drop2.paddingLeft = 15;
    drop2.delegate = self;
    drop2.type = IGLDropDownMenuTypeStack;
    drop2.flipWhenToggleView = YES;
    [drop2 reloadView];
    [self.view addSubview:drop2];

    //Block for Selection
    [drop1 addSelectedItemChangeBlock:^(NSInteger selectedIndex) {
    IGLDropDownItem *item = dropdownItems[selectedIndex];
    NSLog(@"Selected: %@", item.text);
    }];

}

from igldropdownmenu.

bestwnh avatar bestwnh commented on August 26, 2024

@MattFedo now checkout the newest code and it should working.

from igldropdownmenu.

MattFedo avatar MattFedo commented on August 26, 2024

Cool thanks!

from igldropdownmenu.

Related Issues (20)

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.