views:

67

answers:

2

I'm trying to display a ActionSheet when a screen is touched within scrollview. The action sheet pops fine within 1st page. But on subsequent pages, the screen becomes dark and doesn't displaying anything... as if actual button is displaying on the off screen. I played around with frame positioning of UIActionSheet.. but it doesn't seem to work... Any ideas???

self.view.frame.origin.x seems to have correct ScrollView position.

Thanks,

UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Jump to First Page", @"Browse Pages",nil];

CGRect frame = CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y, 480.0f, 320.0f);
[actionSheet setFrame:frame]; [actionSheet showInView:self.view];

A: 

You are displaying it inside the scrollview, which will not work, because you are right, it is displayed off screen. you shouldn't display it inside the scrollview, rather, put the Scrollview in another view and display the ActionSheet inside that view.

Richard J. Ross III
anthony
+1  A: 

Assuming your UIScrollView is contained in the view of a UIViewController.

You should then display that UIActionSheet inside the root view of the view controller.

St3fan
anthony
That is because the `UIWindow` does not rotate. Only `UIViewControllers` do. (Where 'rotate' really is applying a transformation to change the coordinate system)
St3fan