I 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 ?
Asked
Active
Viewed 148 times
0
GameFreak
- 63
- 8
-
probably your problem is similar to this one http://stackoverflow.com/q/1281211/1030951 – HarshIT Jul 04 '13 at 11:03
-
you can see this http://www.dbuggr.com/leothenerd/add-transparent-uitextview-cocos2d-iphone-layer/ – shaqir saiyed Jul 04 '13 at 11:21
3 Answers
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