1

I've a screen:

enter image description here

The container view load a xib(UIViewController) as a sub view with no problems. When I load another xib(UIViewController) as a sub view (dialog):

enter image description here

But the dialog view loads on top of the container view. I want to dialog view show in the center of the screen.

Loading the container view:

WallPostsTableView *wpVC = [[WallPostsTableView alloc] initWithNibName:@"WallPostsTableView" bundle:nil];
    wpVC.view.frame = self.viewTableWallPosts.bounds;
    [self.viewTableWallPosts addSubview:wpVC.view];
    [self addChildViewController:wpVC];
    [wpVC didMoveToParentViewController:self];

Loading the dialog from the container view:

Dialog_Wall_Messages *dwmVC = [[Dialog_Wall_Messages alloc] initWithNibName:@"Dialog_Wall_Messages" bundle:nil];
    dwmVC.view.center = self.view.center;
    [self.view addSubview:dwmVC.view];
    [self addChildViewController:dwmVC];
    [dwmVC didMoveToParentViewController:self];

EDIT 1: The dialog is a subview of the subview.

EDIT 2: I changed the whole concept, so it's not important anymore.

Idan Moshe
  • 1,675
  • 4
  • 28
  • 65

0 Answers0