Search code examples
iphoneuiviewsdkoverlapping

Overlapping AwesomeMenu's cover each other


I have added two AwesomeMenu's to the view of my view controller. The problem is that one covers the other and the first one does not even show up. I've tried to set the background to clearColor (which, I think, is the default, anyway), but that does nothing. Of course, I can set the frames of the two AwesomeMenu views to be non-overlapping, but that would cause the view of the AwesomeMenu to be too small to fit all its menu items.
I'm probably missing something simple here. Thanks for the help.

   self.colorMenu = [[AwesomeMenu alloc]initWithFrame:self.view.bounds startItem:startItem optionMenus:startMenuItems];
self.colorMenu.startPoint = CGPointMake(self.view.bounds.size.width/2.0,
                                   self.view.bounds.size.height - starImage.size.height);
self.colorMenu.menuWholeAngle = M_PI;
self.colorMenu.rotateAngle = -M_PI_2;
self.colorMenu.delegate = self;
[self.view addSubview:self.colorMenu];

// brush menu
NSMutableArray *brushMenuItems = [[NSMutableArray  alloc] initWithCapacity:10];
for (int i=0; i<5; i++) {
    AwesomeMenuItem *menuItem = [[AwesomeMenuItem alloc] initWithImage:storyMenuItemImage
                                                      highlightedImage:storyMenuItemImagePressed
                                                          ContentImage:starImage
                                               highlightedContentImage:nil];
    [brushMenuItems addObject:menuItem];
}
self.brushMenu = [[AwesomeMenu alloc]initWithFrame:self.view.bounds startItem:startItem optionMenus:brushMenuItems];
self.brushMenu.startPoint = CGPointMake(self.view.bounds.size.width*.3,
                                        self.view.bounds.size.height - starImage.size.height);
self.brushMenu.menuWholeAngle = M_PI;
self.brushMenu.rotateAngle = -M_PI_2;
self.brushMenu.delegate = self;
[self.view addSubview:self.brushMenu];

Solution

  • You had known, it just should have to create two startItem object, and assign to each menu.

    If you have some thought, please open an issue or pull requests to the repo.