LMDropdownView icon indicating copy to clipboard operation
LMDropdownView copied to clipboard

Black background bizarre when use showInView

Open Quadram opened this issue 7 years ago • 4 comments

Hi,

Problem using: - (void)showInView:(UIView *)containerView withContentView:(UIView *)contentView atOrigin:(CGPoint)origin;

Init dropdown view with default style and show in UITableView. When we scroll in the table and then show 'LMDropdownView' the problem arises.

simulator screen shot 7 sept 2016 12 58 59

Scroll on point zero working fine:

simulator screen shot 7 sept 2016 12 59 07

Congratulations for the project. Thank you very much.

Quadram avatar Sep 07 '16 11:09 Quadram

hi @Quadram ,

With this method

  • (void)showInView:(UIView *)containerView withContentView:(UIView *)contentView atOrigin:(CGPoint)origin;

The 'containerView' should be the view of your view controller (self.view) or navigation controller (self.navigationController.view). If the problem still occurs, please post some code so I can find the way to fix it.

Thank you.

lminhtm avatar Sep 08 '16 09:09 lminhtm

Hi @lminhtm , thank you for your response.

I want to display the view on my table, I don't want display on the view of my view controller (self.view) or navigation controller (self.navigationController.view).

Then attached capture as I want to show my containerView:

simulator screen shot 13 sept 2016 11 36 37

And so it would show as you say to me:

simulator screen shot 13 sept 2016 11 37 25

I use the following code:

`- (void)showDropDownViewFromDirection:(LMDropdownViewDirection)direction {

// Init dropdown view
if (!self.dropdownView) {
    self.dropdownView = [LMDropdownView dropdownView];
    self.dropdownView.delegate = self;

    // Customize Dropdown style
    self.dropdownView.closedScale = 1;
    self.dropdownView.animationDuration = 0.4;
    self.dropdownView.animationBounceHeight = 10;
}
self.dropdownView.direction = direction;

// Show/hide dropdown view
if ([self.dropdownView isOpen]) {
    [self.dropdownView hide];
}
else {

    self.dropdownView.contentBackgroundColor = [UIColor customGreenLightLight];

    if(![self.tableViewPointsNear isHidden]) {
        [self.dropdownView showInView:self.tableViewPointsNear withContentView:self.tableViewSectors atOrigin:CGPointZero];
    }
    else {
        [self.dropdownView showInView:self.mapViewPointsNear withContentView:self.tableViewSectors atOrigin:CGPointZero];
    }
}

}`

Thanks for your help and sorry for my English.

Quadram avatar Sep 13 '16 09:09 Quadram

hi @Quadram,

The dropdown view was't designed for displaying inside a tableview at the beginning, so I think you should try to display it in your view controller and modify the origin and your bottom buttons.

Thanks for your report 👍

lminhtm avatar Sep 14 '16 04:09 lminhtm

@Quadram how do you control the origin of the dropdown menu?

famictech2000 avatar Jan 09 '17 01:01 famictech2000