Проблема заключается в размере кадра вашего TestViewController и методе добавления UIView в качестве вспомогательного вида UIActionSheet
.
Внесите следующие изменения, и он будет корректно отклонен!
Реализуйте willPresentActionSheet
и addSubView
в этом методе
- (IBAction)pressed:(id)sender
{
UIActionSheet *myActionSheet = [[UIActionSheet alloc] initWithTitle:@"\n\n" delegate:self cancelButtonTitle:@"cancel" destructiveButtonTitle:@"done" otherButtonTitles:nil];
[myActionSheet showInView:self.view];
[myActionSheet release];
}
- (void) willPresentActionSheet:(UIActionSheet *)actionSheet{
TestViewController *myVC = [[TestViewController alloc] init];
[actionSheet addSubview:myVC.view];
}
И в viewDidLoad
изTestViewController
, набор
- (void)viewDidLoad
{
self.view.frame = CGRectMake(0,0 , 320, 60);
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
}