Comments (4)
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.
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.
@MattFedo now checkout the newest code and it should working.
from igldropdownmenu.
Cool thanks!
from igldropdownmenu.
Related Issues (20)
- Unable to set width of IGLDropDownMenuItem HOT 5
- Make dropDown view above below views? HOT 1
- Dropdown hides behind the dropdown below it HOT 1
- Is there a way or delegate method to detect if the menu is tapped/open? HOT 9
- updating cocoapods HOT 3
- storyboard custom menu button HOT 1
- Great component! Scrolling? HOT 10
- Add UITapGesture to close menu HOT 8
- If anyone think it should re-write to a swift version, please leave a comment in this issue. HOT 5
- How to instantiate this through storyboard? HOT 1
- Can not using autolayout HOT 5
- Changing DropDownItem textLabel stuff not doing anything HOT 6
- My own menu button HOT 2
- Crash: IGLDropDownItem.h HOT 1
- How to make IGLDropDown Menu view as rounded drop downlist? HOT 5
- I'm not able to scroll it HOT 3
- items problems
- In IGLDropDownMenuDirectionUp mode selected index is always 0 HOT 4
- The item may be not selectable if it's outside the screen
- 展开之后,快速点击展开的item,动画会造成跳动,超过布局范围的跳动
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from igldropdownmenu.