tags:

views:

377

answers:

1

Hello,

I have a problem, using presentModalViewController to display a UIView. Within the Application I have a NavigationController with a list of Items. Touching a Cell calls the first ViewController, responsible for only showing a background picture. Within the viewDidLoad method I create another ViewController which has a UiScrollView, displaying some information about the item.

So far so good.

Now, an item can consist of subitems, so if I click on a subitem, I use presentModalViewController to create a new instance of the first ViewController. My problem is, that this newly displayed controller is show around 180px(a guess) lower than it should be. I thought, this was due to relative coordinates I set wrong, but if I click on a subitem with the new (lower) controller, I would expect it to be displayed lower again (say 360px) - relative to the topleft corner of the Iphone.

Anyway, this doesnt happen. My question is why is the new controller displayed lower than it should be/I expect it to be. Spent a few hours on this, so any ideas are appreciated!

Edit: Some Code - this is the part, where i present the controller:

ItemDetailsViewController  *itemScrl= [[ItemDetailsViewController alloc]    initWithNibName:@"ItemDetailsViewController"  bundle:nil];

itemScrl.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;

[self presentModalViewController:itemScrl   animated:YES];

This is the part, where I create the scrollable View:

- (void)viewDidLoad {
[super viewDidLoad];

ItemScrollController *itemScrl = [[ItemScrollController alloc]    initWithNibName:@"ItemScrollController" bundle:nil];
itemScrl.title = self.title;
itemScrl.view.frame = CGRectMake(20 , 0, 280, 400);
[self.view addSubview:itemScrl.view];
}