我希望在
如何在所有屏幕方向中将“按视图付费”放置在屏幕中央?
UIViewController
上实现以下自定义视图。除了使用addSubview之外,有什么更好的方法可以实现它?
我之前使用过以下方法,但现在想使用更好的方法:[self.view addSubview:NotConnected.view];
[self.view removeFromSuperview];
我已经使用https://github.com/wimagguc/ios-custom-alertview实现了代码。
我不想使用库,那么如何像上面的图片一样自定义一个UIViewController
来覆盖另一个UIViewController
呢?
- (IBAction)ContinueToPayment:(id)sender {
PayByVC *Newpage = [[PayByVC alloc] initWithNibName:@"PayByVC" bundle:nil];
Newpage.checkOutInfoDict=checkOutDict;
Newpage.modalPresentationStyle = UIModalPresentationOverCurrentContext;
Newpage.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
Newpage.view.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:.4];
Newpage.delegate = self;
[self presentViewController:Newpage animated:YES completion:nil];
}
我使用了以下代码从父视图中移除:
[self dismissViewControllerAnimated:YES completion:nil];
如何在所有屏幕方向中将“按视图付费”放置在屏幕中央?