/ Published in: Objective C
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
-(IBAction)buttonClick:(id)sender { PurchaseWindowViewController* viewController = [[PurchaseWindowViewController alloc] initWithNibName:@"PurchaseWindowViewController" bundle:nil]; UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:viewController]; navController.modalPresentationStyle = UIModalPresentationFormSheet; navController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; viewController.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Cancel", @"") style:UIBarButtonItemStyleBordered target:self action:@selector(close)]; [self presentModalViewController:navController animated:YES]; //targetController.view.superview.frame = CGRectMake(0, 0, 200, 200);//it's important to do this after presentModalViewController //targetController.view.superview.center = self.view.center; // Clean up resources [navController release]; [viewController release]; } - (void)close { [self dismissModalViewControllerAnimated:YES]; }