0

enter image description hereI need to create a view like this. Where my actionsheet like view is a subview added on viewcontroller. Its not real action sheet. What i want to keep the controls behind the overlay view touchable also the action sheet buttons. Can anyone suggest, How to do it ?

GameFreak
  • 63
  • 8

3 Answers3

0

Something like this:

UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Test Action Sheet" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Home",@"iPhone", nil];
    [actionSheet showInView:self.navigationController.view];
Anton
  • 2,797
  • 1
  • 12
  • 6
0

Take one UIImageView on front of all views and set Alpha something like bellow..

[imgBackShadow setAlpha:0.9];// set yourImage name instead of imgBackShadow
// Also set different value to Alpha with your requirement

First setHidden to YES and when you want to open UIActionSheet at that time just setHidden to NO also set property setUserInteractionEnabled to NO like bellow..

[imgBackShadow setUserInteractionEnabled:NO];// set yourImage name instead of imgBackShadow

Example : when you want to open UIActionSheet at that time use bellow code..

[imgBackShadow setHidden:NO];
[self.view bringSubviewToFront:imgBackShadow];
[self.view bringSubviewToFront:yourActionSheet];

and when you want to close UIActionSheet at that time just Hide that Image like bellow..

[imgBackShadow setHidden:YES];

hope its helpful to you..

Paras Joshi
  • 20,427
  • 11
  • 57
  • 70
0

My action sheet is a custom View, I used a Button on view above the action sheet. After disabling user interaction and setting alpha .7 worked for me .

GameFreak
  • 63
  • 8