In my table cells, there is a button that displays a drop-down menu when you click on it. The problem is, the drop-down menu exceeds the height of the cell and bleeds into the cell below.

enter image description here

In that case, if I click the item in the drop-down, it actually acts as I clicked the cell below.

I tried using the code below but it doesn't seem to work.

    [super bringSubviewToFront:dropDown];
    [super willMoveToSuperview:dropDown];

The function that shows the drop-down is defined in the custom class for the table cell:

- (IBAction)eventAction:(id)sender {
    NSArray * arr = [[NSArray alloc] init];
    arr = [NSArray arrayWithObjects:@"Hello 0", @"Hello 1",nil];
    NSArray * arrImage = [[NSArray alloc] init];
    arrImage = [NSArray arrayWithObjects:[UIImage imageNamed:@"apple.png"], [UIImage imageNamed:@"apple2.png"], nil];
    if(dropDown == nil) {
        CGFloat f = 100;
        dropDown = [[NIDropDown alloc]showDropDown:sender :&f :arr :arrImage :@"down"];
        dropDown.delegate = self;

        dropDown.layer.zPosition = 1;
        [super bringSubviewToFront:dropDown];
        [super willMoveToSuperview:dropDown];
    }else {
        [dropDown hideDropDown:sender];
        [self rel];
    }
}

Any help is greatly appreciated!!

Thank you!!

Related posts

Recent Viewed