你的問題是不是clear.I假設你想展示你的視圖控制器,而不是在centre.If顯示,使項目彈出的頂尖流行,那麼這就是你的解決方案:
我會解釋github project
你發佈你的問題。 你可以在自己的項目中改變你想要的東西。轉到ENViewController.m
。而修改代碼,
- (IBAction)showPopUp:(id)sender
{
UIViewController *vc = [[UIStoryboard storyboardWithName:@"Main_iPhone" bundle:nil] instantiateViewControllerWithIdentifier:@"PopUp"];
vc.view.frame = CGRectMake(20, 30, 270.0f, 230.0f);
[self presentPopUpViewController:vc];
}
你也可以改變你的彈出式視圖 - 控制尺寸和更新的大小,高度在這行你showpopup action method:
vc.view.frame = CGRectMake(20, 30, Any size, Any height);
如果你想改變你的彈出鑑於現在的位置指。你可以使用任何X,Y值在這一行上您showpopup action method:
vc.view.frame = CGRectMake(x, Y, Any size, Any height);
然後去UIViewController+ENPopUp.m
在下//自定義popUpView.delete一行(我有評論)。
// Customize popUpView
popUpView.layer.cornerRadius = 8.0f;
popUpView.layer.masksToBounds = YES;
popUpView.layer.zPosition = 99;
popUpView.tag = kENPopUpViewTag;
//popUpView.center = overlayView.center;
[popUpView setNeedsLayout];
[popUpView setNeedsDisplay];
[overlayView addSubview:popUpView];
[sourceView addSubview:overlayView];
希望這個幫助。如果不是請清楚地問你的問題。讓我知道!
@克里斯蒂亞諾阿爾維斯你能幫我嗎 – AAAbi
爲什麼致力於我的問題。而不是致力。你可以解釋我爲什麼? – AAAbi