Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

menu location when adding the button to Viewcontroller subviews #7

Open
tomhoffen opened this issue Jun 26, 2016 · 0 comments
Open

Comments

@tomhoffen
Copy link
Contributor

Hi,

I want to use this button in UIScrollView.
I want to create many small UIViews and add the button to each view.
The problem is that the menu opening location is wrong.

Now the origin is calculated in row number 97 as follows:
origin = [self.superview convertPoint:self.frame.origin toView:nil];

Later you have this condition:
if (!CGPointEqualToPoint(origin,self.frame.origin)) {
selectorViewFrame.origin.x -= origin.x;
selectorViewFrame.origin.y -= origin.y;
}

I solved the problem by doing 2 things:

  1. calculating the origin as follows:
    origin = self.frame.origin;
  2. In addition I removed the if statement.

I wonder what is the right way to calculate the origin.

Thanks,
Tom

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant