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

Misalignment when parentView is of type UITableView #12

Closed
RobCroll opened this issue Oct 17, 2013 · 3 comments
Closed

Misalignment when parentView is of type UITableView #12

RobCroll opened this issue Oct 17, 2013 · 3 comments

Comments

@RobCroll
Copy link

If you scroll down a page in table view and then select a cell that displays CustomIOS7AlertView, the view is located at the top of the table. Need to add following code to CustomIOS7AlertView show method.

if ([parentView isKindOfClass:[UITableView class]]) {

    UITableView *tableView = (UITableView *)parentView;

    self.frame = CGRectMake(tableView.contentOffset.x, tableView.contentOffset.y, tableView.bounds.size.width, tableView.bounds.size.height);
}

I placed code immediately after [parentView addSubview:self];

@wimagguc
Copy link
Owner

Thanks for your feedback. Have you seen the new init method, where you don't have to pass the parent view anymore? Perhaps it will solve your problem out of the box; works like this:

CustomIOS7AlertView *alertView = [[CustomIOS7AlertView alloc] init];

(Also, it's better to keep the code as generic as possible. Each and every such if-statement would make maintenance a bit harder.)

@RobCroll
Copy link
Author

Agreed. I did get latest and noticed you are still supporting parentView. Is there actually any need for parentView now?
Also thanks for sharing, it really helped me out of an iOS7 hole.

@wimagguc
Copy link
Owner

Glad to hear you can use it!
(The parent view code is there for now for backwards compatibility. Will be removed soon, now I'm waiting to see if it works correctly with everyone's app, before ripping it out from the code base.)

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

2 participants