我不知道如何实现它,但下图显示了我想要出现的模态大小:
我用于推送模态视图的代码是:
CustomerLogin *customerlogin = [[CustomerLogin alloc] initWithNibName:@"CustomerLogin" bundle:nil];
[self presentModalViewController:customerlogin animated:YES];
[customerlogin release];
编辑 - -
做出如下建议的更改,如下所示:
UIView *overlay = [[UIView alloc] initWithFrame:self.view.bounds];
overlay.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5]; // Black color
[self.navigationController.view addSubview:overlay];
//Add Login View
CustomerLogin *loginView = [[CustomerLogin alloc] initWithFrame:CGRectMake(0,0, 200, 300)]; //I guessed a size
loginView.center = overlay.center; //Center the view
[overlay addSubview:loginView];
得到3个错误:
CustomerLogin 上不存在属性中心 CustomerLogin 不会响应 initWithFrame 不兼容的指针类型发送 CustomerLogin* 以键入 UIView*